]> git.mxchange.org Git - friendica.git/commitdiff
Fixes warning "missing terminating ] for character class"
authorMichael <heluecht@pirati.ca>
Fri, 6 Apr 2018 09:11:10 +0000 (09:11 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 6 Apr 2018 09:11:10 +0000 (09:11 +0000)
src/Content/Text/BBCode.php

index 7615ab08a8d21af1136a1a0cf1a683cf408eea10..97b809211801277b753922ff9e65aab6dda47304 100644 (file)
@@ -242,9 +242,10 @@ class BBCode extends BaseObject
                        // Simplify image codes
                        $body = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $body);
 
+                       $URLSearchString = "^\[\]";
+
                        $body = preg_replace("/\[img\=([$URLSearchString]*)\](.*?)\[\/img\]/ism", '[img]$1[/img]', $body);
 
-                       $URLSearchString = "^\[\]";
                        if (preg_match_all("(\[url=([$URLSearchString]*)\]\s*\[img\]([$URLSearchString]*)\[\/img\]\s*\[\/url\])ism", $body, $pictures, PREG_SET_ORDER)) {
                                if ((count($pictures) == 1) && !$has_title) {
                                        // Checking, if the link goes to a picture