mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Removed format characters correctly :)
This commit is contained in:
parent
547aa2ae31
commit
1d1766a876
@ -70,9 +70,9 @@ abstract class TextFormat{
|
|||||||
*/
|
*/
|
||||||
public static function clean($string, $removeFormat = true){
|
public static function clean($string, $removeFormat = true){
|
||||||
if($removeFormat){
|
if($removeFormat){
|
||||||
return preg_replace(["/§[0123456789abcdefklmnor]/", "/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/"], "", $string);
|
return str_replace("§", "", preg_replace(["/§[0123456789abcdefklmnor]/", "/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/"], "", $string));
|
||||||
}
|
}
|
||||||
return preg_replace("/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/", "", $string);
|
return str_replace("\x1b", "", preg_replace("/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/", "", $string));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user