Fix '&' replacement

This commit is contained in:
Ruan 2015-06-08 17:53:38 +02:00
parent 755cb4c221
commit 6bdd5bda5f

View File

@ -42,11 +42,11 @@ function millis_to_date($millis) {
* @param $text
*/
function clean($text) {
$text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
if (strstr($text, "\xa7") || strstr($text, "&")) {
$regex = "/(?i)(\xa7|&)[0-9A-FK-OR]/";
$text = preg_replace($regex, "", $text);
}
$text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
if (strstr($text, "\n")) {
$text = preg_replace("/\n/", "<br>", $text);
}