From c2d1d11123db338be75767b29dcc50929261e67d Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 18 Apr 2020 16:14:38 +0000 Subject: [PATCH] Use constants --- src/Model/Tag.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Model/Tag.php b/src/Model/Tag.php index 6de872a9e5..c3d1c50162 100644 --- a/src/Model/Tag.php +++ b/src/Model/Tag.php @@ -149,8 +149,12 @@ class Tag * @param string $body Body of the post * @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)) { return; }