r31452 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r31451‎ | r31452 | r31453 >
Date:13:57, 2 March 2008
Author:catrope
Status:old
Tags:
Comment:
* (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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/api/ApiFormatBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiFormatBase.php
@@ -188,9 +188,10 @@
189189 $text = preg_replace('/\&lt;(!--.*?--|.*?)\&gt;/', '<span style="color:blue;">&lt;\1&gt;</span>', $text);
190190 // identify URLs
191191 $protos = "http|https|ftp|gopher";
192 - $text = ereg_replace("($protos)://[^ \\'\"()<\n]+", '<a href="\\0">\\0</a>', $text);
 192+ # This regex hacks around bug 13218 (&quot; included in the URL)
 193+ $text = preg_replace("#(($protos)://.*?)(&quot;)?([ \\'\"()<\n])#", '<a href="\\1">\\1</a>\\3\\4', $text);
193194 // identify requests to api.php
194 - $text = ereg_replace("api\\.php\\?[^ \\()<\n\t]+", '<a href="\\0">\\0</a>', $text);
 195+ $text = preg_replace("#api\\.php\\?[^ \\()<\n\t]+#", '<a href="\\0">\\0</a>', $text);
195196 if( $this->mHelp ) {
196197 // make strings inside * bold
197198 $text = ereg_replace("\\*[^<>\n]+\\*", '<b>\\0</b>', $text);
Index: trunk/phase3/includes/Title.php
@@ -971,7 +971,7 @@
972972 }
973973
974974 /**
975 - * Is $wgUser is watching this page?
 975+ * Is $wgUser watching this page?
976976 * @return boolean
977977 */
978978 public function userIsWatching() {
Index: trunk/phase3/RELEASE-NOTES
@@ -71,6 +71,7 @@
7272 * (bug 13154) Introduced subpages flag to meta=siteinfo&siprop=namespaces
7373 * (bug 13157) Added ucuserprefix parameter to list=usercontibs
7474 * (bug 12394) Added rctitles parameter to list=recentchanges, making rcid retrieval easier
 75+* (bug 13218) Fix inclusion of " character in hyperlinks
7576
7677 === Languages updated in 1.13 ===
7778

Status & tagging log