Improved Emoji detection
This commit is contained in:
parent
d1eb1ec0f4
commit
e558a83783
1 changed files with 2 additions and 2 deletions
|
@ -287,7 +287,7 @@ class Smilies
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the body only contains 4 byte unicode characters.
|
* Checks if the body doesn't contain any alphanumeric characters
|
||||||
*
|
*
|
||||||
* @param string $body Possibly-HTML post body
|
* @param string $body Possibly-HTML post body
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
@ -308,7 +308,7 @@ class Smilies
|
||||||
for ($i = 0; $i < mb_strlen($conv); $i++) {
|
for ($i = 0; $i < mb_strlen($conv); $i++) {
|
||||||
$character = mb_substr($conv, $i, 1);
|
$character = mb_substr($conv, $i, 1);
|
||||||
|
|
||||||
if (\IntlChar::isalnum($character)) {
|
if (\IntlChar::isalnum($character) || \IntlChar::ispunct($character) || \IntlChar::isgraph($character) && (strlen($character) <= 2)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue