mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 09:49:50 +00:00
Merge branch 'stable'
This commit is contained in:
commit
b4f6c1e1a6
@ -87,6 +87,7 @@ abstract class TextFormat{
|
|||||||
*/
|
*/
|
||||||
public static function clean(string $string, bool $removeFormat = true) : string{
|
public static function clean(string $string, bool $removeFormat = true) : string{
|
||||||
$string = mb_scrub($string, 'UTF-8');
|
$string = mb_scrub($string, 'UTF-8');
|
||||||
|
$string = preg_replace("/[\x{E000}-\x{F8FF}]/u", "", $string); //remove unicode private-use-area characters (they might break the console)
|
||||||
if($removeFormat){
|
if($removeFormat){
|
||||||
$string = str_replace(TextFormat::ESCAPE, "", preg_replace("/" . TextFormat::ESCAPE . "[0-9a-fk-or]/u", "", $string));
|
$string = str_replace(TextFormat::ESCAPE, "", preg_replace("/" . TextFormat::ESCAPE . "[0-9a-fk-or]/u", "", $string));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user