Use constants
This commit is contained in:
parent
0f2215bc17
commit
c2d1d11123
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue