r47871 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47870‎ | r47871 | r47872 >
Date:19:36, 27 February 2009
Author:catrope
Status:ok
Tags:
Comment:
API: Fix autolinker bug reported by DannyB on IRC: > was included in the URL
Modified paths:
  • /trunk/phase3/includes/api/ApiFormatBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiFormatBase.php
@@ -219,7 +219,7 @@
220220 // identify URLs
221221 $protos = implode("|", $wgUrlProtocols);
222222 # This regex hacks around bug 13218 (" included in the URL)
223 - $text = preg_replace("#(($protos).*?)(&quot;)?([ \\'\"<\n])#", '<a href="\\1">\\1</a>\\3\\4', $text);
 223+ $text = preg_replace("#(($protos).*?)(&quot;)?([ \\'\"<>\n]|&lt;|&gt;|&quot;)#", '<a href="\\1">\\1</a>\\3\\4', $text);
224224 // identify requests to api.php
225225 $text = preg_replace("#api\\.php\\?[^ \\()<\n\t]+#", '<a href="\\0">\\0</a>', $text);
226226 if( $this->mHelp ) {

Status & tagging log