mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-17 06:52:49 +00:00
添加过滤昵称字符
This commit is contained in:
parent
d6b2722764
commit
ef1089196c
@ -57,4 +57,16 @@ function makePathToUrl($path,$type = 2)
|
|||||||
return trim(str_replace(DS, '/',UPLOAD_PATH.$path),'.');
|
return trim(str_replace(DS, '/',UPLOAD_PATH.$path),'.');
|
||||||
}else return '';
|
}else return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
// 过滤掉emoji表情
|
||||||
|
function filterEmoji($str)
|
||||||
|
{
|
||||||
|
$str = preg_replace_callback( //执行一个正则表达式搜索并且使用一个回调进行替换
|
||||||
|
'/./u',
|
||||||
|
function (array $match) {
|
||||||
|
return strlen($match[0]) >= 4 ? '' : $match[0];
|
||||||
|
},
|
||||||
|
$str);
|
||||||
|
|
||||||
|
return $str;
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user