r8487 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r8486‎ | r8487 | r8488 >
Date:06:28, 21 April 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 1636) Refs like ţ were misinterpreted as octal in some places
Backport test case and one-line fix from HEAD
Modified paths:
  • /branches/REL1_4/phase3/includes/GlobalFunctions.php (modified) (history)
  • /branches/REL1_4/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: branches/REL1_4/phase3/maintenance/parserTests.txt
@@ -991,6 +991,18 @@
992992 </p>
993993 !! end
994994
 995+!! test
 996+Interwiki link encoding conversion (bug 1636)
 997+!! input
 998+*[[Wikipedia:ro:Olteni&#0355;a]]
 999+*[[Wikipedia:ro:Olteni&#355;a]]
 1000+!! result
 1001+<ul><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class='extiw' title="Wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#0355;a</a>
 1002+</li><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class='extiw' title="Wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a>
 1003+</li></ul>
 1004+
 1005+!! end
 1006+
9951007 ##
9961008 ## XHTML tidiness
9971009 ###
Index: branches/REL1_4/phase3/includes/GlobalFunctions.php
@@ -213,7 +213,7 @@
214214 function wfMungeToUtf8( $string ) {
215215 global $wgInputEncoding; # This is debatable
216216 #$string = iconv($wgInputEncoding, "UTF-8", $string);
217 - $string = preg_replace ( '/&#([0-9]+);/e', 'wfUtf8Sequence($1)', $string );
 217+ $string = preg_replace ( '/&#0*([0-9]+);/e', 'wfUtf8Sequence($1)', $string );
218218 $string = preg_replace ( '/&#x([0-9a-f]+);/ie', 'wfUtf8Sequence(0x$1)', $string );
219219 # Should also do named entities here
220220 return $string;

Follow-up revisions

RevisionCommit summaryAuthorDate
r8488* (bug 1636) Refs like &#0355; were misinterpreted as octal in some placesvibber06:29, 21 April 2005
r41507Reverting r41410 -- broke interwikis totally in parser tests....brion16:59, 1 October 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r8484Test case for bug 1636vibber06:04, 21 April 2005
r8486* (bug 1636) Refs like &#0355; were misinterpreted as octal in some placesvibber06:20, 21 April 2005

Status & tagging log