D
D
Dragonzcxv2021-08-27 08:35:58
1C-Bitrix
Dragonzcxv, 2021-08-27 08:35:58

Why are non-breaking spaces escaped in regular inputs in the bitirix admin?

Hello! If you enter the string " Тестовая и&nbsp;строка<br/>тут" into the property of an element, for example, then when saving, the non-breaking space is escaped, but the tag remains. How to avoid escaping like this, can it be configured somewhere?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2021-08-27
@Dragonzcxv

This is the standard behavior of html - to interpret special characters (< br> is not a special character, in input text it is understandably interpreted as text), Bitrix is ​​not to blame for this.
In text fields, for example, in the description for the announcement, when you write &nbsp;something actually there &amp;nbsp;
You can also do it, but you will have to edit the templates where these values ​​are displayed

$value = 'Тестовая и&amp;nbsp;строка<br/>тут';
htmlspecialchars_decode($value)

// скорее всего даже
htmlspecialchars_decode(htmlspecialchars_decode($value)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question