From: Roan Kattouw Date: Sun, 2 Mar 2008 13:57:56 +0000 (+0000) Subject: * (bug 13218) Fix inclusion of " character in hyperlinks X-Git-Tag: 1.31.0-rc.0~49291 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=30842f073db026443d5b9a07e92a28fab8562bfb;p=lhc%2Fweb%2Fwiklou.git * (bug 13218) Fix inclusion of " character in hyperlinks * Using preg_replace rather than ereg_replace in formatHTML() (faster according to php.net) * Correcting grammatical error in Title::userIsWatching() description --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 34ba8bc716..2eae85ce24 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Title.php b/includes/Title.php index 3e7f1c5d4b..d1164277cc 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -971,7 +971,7 @@ class Title { } /** - * Is $wgUser is watching this page? + * Is $wgUser watching this page? * @return boolean */ public function userIsWatching() { diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 4bc06e2dea..6863193990 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -188,9 +188,10 @@ See complete documentation, or $text = preg_replace('/\<(!--.*?--|.*?)\>/', '<\1>', $text); // identify URLs $protos = "http|https|ftp|gopher"; - $text = ereg_replace("($protos)://[^ \\'\"()<\n]+", '\\0', $text); + # This regex hacks around bug 13218 (" included in the URL) + $text = preg_replace("#(($protos)://.*?)(")?([ \\'\"()<\n])#", '\\1\\3\\4', $text); // identify requests to api.php - $text = ereg_replace("api\\.php\\?[^ \\()<\n\t]+", '\\0', $text); + $text = preg_replace("#api\\.php\\?[^ \\()<\n\t]+#", '\\0', $text); if( $this->mHelp ) { // make strings inside * bold $text = ereg_replace("\\*[^<>\n]+\\*", '\\0', $text);