* (bug 15392) ApiFormatBase::formatHTML now uses $wgUrlProtocols.
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sun, 31 Aug 2008 17:11:22 +0000 (17:11 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sun, 31 Aug 2008 17:11:22 +0000 (17:11 +0000)
CREDITS
RELEASE-NOTES
includes/api/ApiFormatBase.php

diff --git a/CREDITS b/CREDITS
index d5a5ac0..0d9130c 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -23,6 +23,7 @@ following names for their contribution to the product.
 * MinuteElectron
 * Mohamed Magdy
 * Niklas Laxström
+* Platonides
 * Purodha Blissenbach
 * Raimond Spekking
 * Roan Kattouw
index 717c3d6..300d6ae 100644 (file)
@@ -199,13 +199,15 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   section with section=new
 * Database replication lag doesn't cause all action=edit requests to return the
   nochange flag any more
+* (bug 15392) ApiFormatBase::formatHTML now uses $wgUrlProtocols.
+
 
 === Languages updated in 1.14 ===
 
 MediaWiki supports over 300 languages. Many localisations are updated
 regularly. Below only new and removed languages are listed.
 
-* Fiji Hindi (Devanagari script) (hif-deva)
+* Fiji Hindi (Devanagari script) (hif-deva)
 * Krio (kri)
 * Lezghian (lez)
 * Laz (lzz)
index be131b3..834588a 100644 (file)
@@ -192,15 +192,17 @@ See <a href='http://www.mediawiki.org/wiki/API'>complete documentation</a>, or
        * This method also replaces any '<' with &lt;
        */
        protected function formatHTML($text) {
+               global $wgUrlProtocols;
+               
                // Escape everything first for full coverage
                $text = htmlspecialchars($text);
 
                // encode all comments or tags as safe blue strings
                $text = preg_replace('/\&lt;(!--.*?--|.*?)\&gt;/', '<span style="color:blue;">&lt;\1&gt;</span>', $text);
                // identify URLs
-               $protos = "http|https|ftp|gopher";
+               $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])#", '<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 ) {