Add support for Unicode in Model\Tag::store

2022.09-rc
Hypolite Petovan 2020-12-21 01:29:51 -05:00
rodzic 71bd6c674b
commit f0eeb4900f
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -70,8 +70,8 @@ class Tag
public static function store(int $uriid, int $type, string $name, string $url = '', $probing = true)
{
if ($type == self::HASHTAG) {
// Remove some common "garbarge" from tags
$name = trim($name, "\x00..\x20\xFF#!@,;.:'/?!^°$%".'"');
// Trim Unicode non-word characters
$name = preg_replace('/(^\W+)|(\W+$)/us', '', $name);
$tags = explode(self::TAG_CHARACTER[self::HASHTAG], $name);
if (count($tags) > 1) {