From 30842f073db026443d5b9a07e92a28fab8562bfb Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sun, 2 Mar 2008 13:57:56 +0000 Subject: [PATCH] * (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 --- RELEASE-NOTES | 1 + includes/Title.php | 2 +- includes/api/ApiFormatBase.php | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) 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); -- 2.20.1