r92036 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92035‎ | r92036 | r92037 >
Date:00:27, 13 July 2011
Author:catrope
Status:ok
Tags:
Comment:
Use wfUrlProtocols() in ApiFormatBase instead of simply imploding $wgUrlProtocols and expecting that to work
Modified paths:
  • /trunk/phase3/includes/api/ApiFormatBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiFormatBase.php
@@ -265,7 +265,7 @@
266266 // encode all comments or tags as safe blue strings
267267 $text = preg_replace( '/\&lt;(!--.*?--|.*?)\&gt;/', '<span style="color:blue;">&lt;\1&gt;</span>', $text );
268268 // identify URLs
269 - $protos = implode( "|", $wgUrlProtocols );
 269+ $protos = wfUrlProtocols();
270270 // This regex hacks around bug 13218 (&quot; included in the URL)
271271 $text = preg_replace( "#(($protos).*?)(&quot;)?([ \\'\"<>\n]|&lt;|&gt;|&quot;)#", '<a href="\\1">\\1</a>\\3\\4', $text );
272272 // identify requests to api.php

Follow-up revisions

RevisionCommit summaryAuthorDate
r921721.17wmf1: MFT protocol-relative URL fixes: r91663, r92024, r92028, r92036, r9...catrope17:48, 14 July 2011
r92573Follow up r92036. The global is not needed now.platonides20:31, 19 July 2011

Status & tagging log