* (bug 13218) Fix inclusion of " character in hyperlinks
authorRoan Kattouw <catrope@users.mediawiki.org>
Sun, 2 Mar 2008 13:57:56 +0000 (13:57 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sun, 2 Mar 2008 13:57:56 +0000 (13:57 +0000)
* Using preg_replace rather than ereg_replace in formatHTML() (faster according to php.net)
* Correcting grammatical error in Title::userIsWatching() description

RELEASE-NOTES
includes/Title.php
includes/api/ApiFormatBase.php

index 34ba8bc..2eae85c 100644 (file)
@@ -71,6 +71,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 13154) Introduced subpages flag to meta=siteinfo&siprop=namespaces
 * (bug 13157) Added ucuserprefix parameter to list=usercontibs
 * (bug 12394) Added rctitles parameter to list=recentchanges, making rcid retrieval easier
+* (bug 13218) Fix inclusion of " character in hyperlinks
 
 === Languages updated in 1.13 ===
 
index 3e7f1c5..d116427 100644 (file)
@@ -971,7 +971,7 @@ class Title {
        }
 
        /**
-        * Is $wgUser is watching this page?
+        * Is $wgUser watching this page?
         * @return boolean
         */
        public function userIsWatching() {
index 4bc06e2..6863193 100644 (file)
@@ -188,9 +188,10 @@ See <a href='http://www.mediawiki.org/wiki/API'>complete documentation</a>, or
                $text = preg_replace('/\&lt;(!--.*?--|.*?)\&gt;/', '<span style="color:blue;">&lt;\1&gt;</span>', $text);
                // identify URLs
                $protos = "http|https|ftp|gopher";
-               $text = ereg_replace("($protos)://[^ \\'\"()<\n]+", '<a href="\\0">\\0</a>', $text);
+               # 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);
                // identify requests to api.php
-               $text = ereg_replace("api\\.php\\?[^ \\()<\n\t]+", '<a href="\\0">\\0</a>', $text);
+               $text = preg_replace("#api\\.php\\?[^ \\()<\n\t]+#", '<a href="\\0">\\0</a>', $text);
                if( $this->mHelp ) {
                        // make strings inside * bold
                        $text = ereg_replace("\\*[^<>\n]+\\*", '<b>\\0</b>', $text);