mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-24 00:42:43 +00:00
Support newlines and filter out HTML in ban reasons
This commit is contained in:
parent
40001ad0be
commit
ce63a99279
@ -42,9 +42,13 @@ 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]/";
|
||||
return preg_replace($regex, "", $text);
|
||||
$text = preg_replace($regex, "", $text);
|
||||
}
|
||||
if (strstr($text, "\n")) {
|
||||
$text = preg_replace("/\n/", "<br>", $text);
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user