Removed format characters correctly :)

This commit is contained in:
Shoghi Cervantes 2015-04-14 14:04:10 +02:00
parent 547aa2ae31
commit 1d1766a876

View File

@ -70,9 +70,9 @@ abstract class TextFormat{
*/
public static function clean($string, $removeFormat = true){
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));
}
/**