Trotor Posted August 17, 2018 Share Posted August 17, 2018 Собственно есть дополнительное поле, Текст (много строчек) то есть textarea. Помещаю туда информацию текстовую. Вот в чём вопрос - как дать возможность этому полю воспринимать HTML?Пример:<a href='ССЫЛКА' target='_blank'>ТЕКСТ</a> Link to comment Share on other sites More sharing options...
newbie Posted August 18, 2018 Share Posted August 18, 2018 Дать юзерам возможность добавлять html, включая js? Link to comment Share on other sites More sharing options...
Trotor Posted August 18, 2018 Author Share Posted August 18, 2018 Дать юзерам возможность добавлять html, включая js? Нет.Что бы текстовое поле парсило HTML: Link to comment Share on other sites More sharing options...
newbie Posted August 18, 2018 Share Posted August 18, 2018 Нет.Что бы текстовое поле парсило HTML:А что тогда?Кастомное поле может быть заполнено юзеров. Если Вы будете обрабатывать html, то это явный риск. Link to comment Share on other sites More sharing options...
Trotor Posted August 18, 2018 Author Share Posted August 18, 2018 Кастомное поле может быть заполнено юзеров. Если Вы будете обрабатывать html, то это явный риск. Нет. Дополнительные текстовые поля у меня могут заполнять только администраторы, нет риска.Есть возможность что бы парсились они? Link to comment Share on other sites More sharing options...
newbie Posted August 18, 2018 Share Posted August 18, 2018 \ips_kernel\classCustomFields.php В классе customFieldText есть метод public function view() { /* Make Safe */ $this->value = $this->makeSafeForView( $this->value ); $this->parsed = $this->value; } Можно заменить на public function view() { if (!($this->id == X and $this->plugin_type === 'textarea')) { /* Make Safe */ $this->value = $this->makeSafeForView( $this->value ); } $this->parsed = $this->value; }X - ID поля 1 Link to comment Share on other sites More sharing options...
Trotor Posted August 18, 2018 Author Share Posted August 18, 2018 В классе customFieldText есть методТо что нужно, большое спасибо. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now