1
1
Fork 0

Use constants

This commit is contained in:
Michael 2020-04-18 16:14:38 +00:00
parent 0f2215bc17
commit c2d1d11123

View file

@ -149,8 +149,12 @@ class Tag
* @param string $body Body of the post * @param string $body Body of the post
* @param string $tags Accepted tags * @param string $tags Accepted tags
*/ */
public static function storeFromBody(int $uriid, string $body, string $tags = '#@!') public static function storeFromBody(int $uriid, string $body, string $tags = null)
{ {
if (is_null($tags)) {
$tags = self::TAG_CHARACTER[self::HASHTAG] . self::TAG_CHARACTER[self::MENTION] . self::TAG_CHARACTER[self::EXCLUSIVE_MENTION];
}
if (!preg_match_all("/([" . $tags . "])\[url\=([^\[\]]*)\]([^\[\]]*)\[\/url\]/ism", $body, $result, PREG_SET_ORDER)) { if (!preg_match_all("/([" . $tags . "])\[url\=([^\[\]]*)\]([^\[\]]*)\[\/url\]/ism", $body, $result, PREG_SET_ORDER)) {
return; return;
} }