API: Fix autolinker bug reported by DannyB on IRC: > was included in the URL
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 27 Feb 2009 19:36:34 +0000 (19:36 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 27 Feb 2009 19:36:34 +0000 (19:36 +0000)
includes/api/ApiFormatBase.php

index deab8e3..df8c28e 100644 (file)
@@ -219,7 +219,7 @@ See <a href='http://www.mediawiki.org/wiki/API'>complete documentation</a>, or
                // identify URLs
                $protos = implode("|", $wgUrlProtocols);
                # This regex hacks around bug 13218 (&quot; included in the URL)
-               $text = preg_replace("#(($protos).*?)(&quot;)?([ \\'\"<\n])#", '<a href="\\1">\\1</a>\\3\\4', $text);
+               $text = preg_replace("#(($protos).*?)(&quot;)?([ \\'\"<>\n]|&lt;|&gt;|&quot;)#", '<a href="\\1">\\1</a>\\3\\4', $text);
                // identify requests to api.php
                $text = preg_replace("#api\\.php\\?[^ \\()<\n\t]+#", '<a href="\\0">\\0</a>', $text);
                if( $this->mHelp ) {