Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
parent
16224a7001
commit
397f239abb
|
@ -1222,14 +1222,11 @@ class BBCode
|
||||||
|
|
||||||
public static function removeLinks(string $bbcode)
|
public static function removeLinks(string $bbcode)
|
||||||
{
|
{
|
||||||
$bbcode = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", ' ', $bbcode);
|
|
||||||
$bbcode = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", ' $1 ', $bbcode);
|
$bbcode = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", ' $1 ', $bbcode);
|
||||||
$bbcode = preg_replace("/\[img\](.*?)\[\/img\]/ism", ' ', $bbcode);
|
$bbcode = preg_replace("/\[img.*?\[\/img\]/ism", ' ', $bbcode);
|
||||||
|
|
||||||
$bbcode = preg_replace('/([@!#])\[url\=(.*?)\](.*?)\[\/url\]/ism', '', $bbcode);
|
|
||||||
$bbcode = preg_replace("/\[url\](.*?)\[\/url\]/ism", ' ', $bbcode);
|
|
||||||
$bbcode = preg_replace("/\[url=[^\[\]]*\](.*)\[\/url\]/Usi", ' $1 ', $bbcode);
|
$bbcode = preg_replace("/\[url=[^\[\]]*\](.*)\[\/url\]/Usi", ' $1 ', $bbcode);
|
||||||
$bbcode = preg_replace("/\[url\](.*?)\[\/url\]/ism", ' ', $bbcode);
|
$bbcode = preg_replace('/[@!#]?\[url.*?\[\/url\]/ism', '', $bbcode);
|
||||||
return $bbcode;
|
return $bbcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue