From: Brion Vibber Date: Sat, 15 Nov 2003 14:47:31 +0000 (+0000) Subject: Add compatibility file_get_contents; fix compat iconv X-Git-Tag: 1.1.0~154 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=d1c2cf108b27396113f1bf64b1ab88ed3b597add;p=lhc%2Fweb%2Fwiklou.git Add compatibility file_get_contents; fix compat iconv --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 9efda15070..22ae3ca659 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -29,13 +29,20 @@ if( !function_exists('iconv') ) { # Assume will only ever use utf-8 and iso-8859-1. # This will *not* work in all circumstances. function iconv( $from, $to, $string ) { - if(strcasecmp( $from, to ) == 0) return $string; + 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 ); return $string; } } +if( !function_exists('file_get_contents') ) { + # Exists in PHP 4.3.0+ + function file_get_contents( $filename ) { + return implode( "", file( $filename ) ); + } +} + $wgRandomSeeded = false; function wfSeedRandom()