clean nickname of players

This commit is contained in:
kremsy
2013-12-24 13:27:59 +01:00
parent dccc237c4f
commit 4bdf9d558a
3 changed files with 14 additions and 2 deletions

View File

@ -52,6 +52,15 @@ abstract class Formatter {
return date("Y-m-d H:i:s", $seconds);
}
/**
* Strip all codes except colors from the string
*/
public static function stripCodesWithoutColors($string) {
$string = preg_replace('/(?<!\$)((?:\$\$)*)\$[^$0-9a-hlp]/iu', '$1', $string);
$string = self::stripLinks($string);
return $string;
}
/**
* Strip $codes from the string
*
@ -61,7 +70,7 @@ abstract class Formatter {
public static function stripCodes($string) {
$string = preg_replace('/(?<!\$)((?:\$\$)*)\$[^$0-9a-hlp]/iu', '$1', $string);
$string = self::stripLinks($string);
$string = self::stripColors($string);
//$string = self::stripColors($string);
return $string;
}