Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
parent
16224a7001
commit
397f239abb
1 changed files with 2 additions and 5 deletions
|
@ -1222,14 +1222,11 @@ class 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", ' ', $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\]/ism", ' ', $bbcode);
|
||||
$bbcode = preg_replace('/[@!#]?\[url.*?\[\/url\]/ism', '', $bbcode);
|
||||
return $bbcode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue