diff --git a/includes/Parser.php b/includes/Parser.php index 33bfadfa068..1c8eca9c6a8 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1407,7 +1407,11 @@ class Parser # Still some problems for cases where the ] is meant to be outside punctuation, # and no image is in sight. See bug 2095. # - if( $text !== '' && preg_match( "/^\](.*)/s", $m[3], $n ) ) { + if( $text !== '' && + preg_match( "/^\](.*)/s", $m[3], $n ) && + strpos($text, '[') !== false + ) + { $text .= ']'; # so that replaceExternalLinks($text) works later $m[3] = $n[1]; }