mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 08:29:06 +00:00
Support cleaning hex colours from punishment reasons
This commit is contained in:
parent
d56b589494
commit
8004989501
@ -319,9 +319,12 @@ class Page {
|
|||||||
*/
|
*/
|
||||||
function clean($text) {
|
function clean($text) {
|
||||||
if ($text === null) return null;
|
if ($text === null) return null;
|
||||||
if (strstr($text, "\xa7") || strstr($text, "&")) {
|
if (strstr($text, "\xa7") || strstr($text, "&")) { // Regular chat colours
|
||||||
$text = preg_replace("/(?i)(\x{00a7}|&)[0-9A-FK-OR]/u", "", $text);
|
$text = preg_replace("/(?i)(\x{00a7}|&)[0-9A-FK-OR]/u", "", $text);
|
||||||
}
|
}
|
||||||
|
if (strstr($text, "#")) { // Hex colours
|
||||||
|
$text = preg_replace("/(?i)#[0-9A-F]{6}/u", "", $text);
|
||||||
|
}
|
||||||
$text = htmlspecialchars($text, ENT_QUOTES);
|
$text = htmlspecialchars($text, ENT_QUOTES);
|
||||||
if (strstr($text, "\\n")) {
|
if (strstr($text, "\\n")) {
|
||||||
$text = preg_replace("/\\\\n/", "<br>", $text);
|
$text = preg_replace("/\\\\n/", "<br>", $text);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user