From: Hypolite Petovan Date: Mon, 21 Dec 2020 06:29:51 +0000 (-0500) Subject: Add support for Unicode in Model\Tag::store X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f0eeb4900f2c74bc67cbc0d6c2baae3aa556b71f;p=friendica.git Add support for Unicode in Model\Tag::store --- diff --git a/src/Model/Tag.php b/src/Model/Tag.php index fb7f05ad7f..8ffb5b64f8 100644 --- a/src/Model/Tag.php +++ b/src/Model/Tag.php @@ -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) {