Skip to content

Tag: html-entities

HTMLENTITIES doesn’t work with cyrillics

How can I make htmlentities to work with cyrillic symbols. Now, when I try input some cyrillic: “Тест” it returns “Теє My code: $var = htmlentities($var); Encoding: utf-8. Thanks! Answer In order to bring closure to this question – I want my users not to enter HTML code in the…

PHP XSS sanitization

Questions: What are the best safe1(), safe2(), safe3(), and safe4() functions to avoid XSS for UTF8 encoded pages? Is it also safe in all browsers (specifically IE6)? . Many people say the absolute best that can be done is: . . There are a hell of a lot of posts about PHP and XSS. Most just say “use HTM…