[[Wikinews:Bla]] should not be matched as a news:// URL type.
authorErik Moeller <erik@users.mediawiki.org>
Sun, 7 Nov 2004 10:14:36 +0000 (10:14 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Sun, 7 Nov 2004 10:14:36 +0000 (10:14 +0000)
Change regex to require that URL_PROTOCOLS is at the beginning of a link
(e.g. [[news:bla]]) for it to match.

Note: This will break if someone decides to reverse the order of
replaceExternal and replaceInternal again.

includes/Parser.php

index 2ec45cb..5f115a8 100644 (file)
@@ -1188,7 +1188,7 @@ class Parser
                        # Don't allow internal links to pages containing
                        # PROTO: where PROTO is a valid URL protocol; these
                        # should be external links.
-                       if (preg_match('/((?:'.URL_PROTOCOLS.'):)/', $m[1])) {
+                       if (preg_match('/^((?:'.URL_PROTOCOLS.'):)/', $m[1])) {
                                $s .= $prefix . '[[' . $line ;
                                continue;
                        }