From d1c2cf108b27396113f1bf64b1ab88ed3b597add Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 15 Nov 2003 14:47:31 +0000 Subject: [PATCH] Add compatibility file_get_contents; fix compat iconv --- includes/GlobalFunctions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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() -- 2.20.1