http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70090

Revision: 70090
Author:   platonides
Date:     2010-07-28 13:51:42 +0000 (Wed, 28 Jul 2010)

Log Message:
-----------
It's very nice having a fallback iconv() function, but we should take into 
account that Language.php calls it with the //IGNORE making the fallback a nop.
This fixes the two phpunit tests of Revision of Legacy encoding when native 
iconv is not available in php.

Allow js_unescape to take advantage of our wrapper, too. (although that 
function seems completely unused...)

Modified Paths:
--------------
    trunk/phase3/includes/AjaxFunctions.php
    trunk/phase3/includes/GlobalFunctions.php

Modified: trunk/phase3/includes/AjaxFunctions.php
===================================================================
--- trunk/phase3/includes/AjaxFunctions.php     2010-07-28 13:43:38 UTC (rev 
70089)
+++ trunk/phase3/includes/AjaxFunctions.php     2010-07-28 13:51:42 UTC (rev 
70090)
@@ -49,7 +49,7 @@
        }
 
        if ( $iconv_to != "UTF-8" ) {
-               $decodedStr = iconv( "UTF-8", $iconv_to, $decodedStr );
+               $decodedStr = iconv( "utf-8", $iconv_to, $decodedStr );
        }
 
        return $decodedStr;

Modified: trunk/phase3/includes/GlobalFunctions.php
===================================================================
--- trunk/phase3/includes/GlobalFunctions.php   2010-07-28 13:43:38 UTC (rev 
70089)
+++ trunk/phase3/includes/GlobalFunctions.php   2010-07-28 13:51:42 UTC (rev 
70090)
@@ -25,6 +25,7 @@
        # Assume will only ever use utf-8 and iso-8859-1.
        # This will *not* work in all circumstances.
        function iconv( $from, $to, $string ) {
+               if ( substr( $to, -8 ) == '//IGNORE' ) $to = substr( $to, 0, 
strlen( $to ) - 8 );
                if(strcasecmp( $from, $to ) == 0) return $string;
                if(strcasecmp( $from, 'utf-8' ) == 0) return utf8_decode( 
$string );
                if(strcasecmp( $to, 'utf-8' ) == 0) return utf8_encode( $string 
);
@@ -407,6 +408,7 @@
  */
 function wfErrorLog( $text, $file ) {
        if ( substr( $file, 0, 4 ) == 'udp:' ) {
+               # Needs the sockets extension
                if ( preg_match( 
'!^(tcp|udp):(?://)?\[([0-9a-fA-F:]+)\]:(\d+)(?:/(.*))?$!', $file, $m ) ) {
                        // IPv6 bracketed host
                        $protocol = $m[1];



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to