From: Tim Starling Date: Fri, 8 Aug 2008 03:32:54 +0000 (+0000) Subject: Workaround for PHP 5.2.6 escapeshellcmd()/escapeshellarg() bug X-Git-Tag: 1.31.0-rc.0~46035 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=6e0d253f6d1ec93732f14f5bbe04f67bc7524725;p=lhc%2Fweb%2Fwiklou.git Workaround for PHP 5.2.6 escapeshellcmd()/escapeshellarg() bug --- diff --git a/includes/Setup.php b/includes/Setup.php index cf8aa9b922..270087705d 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -114,6 +114,15 @@ if ( $wgUseSharedUploads ) { } } +/** + * Workaround for http://bugs.php.net/bug.php?id=45132 + * escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale + */ +if ( version_compare( PHP_VERSION, '5.2.6', '>=' ) ) { + putenv( 'LC_CTYPE=en_US.UTF-8' ); + setlocale( LC_CTYPE, 'en_US.UTF-8' ); +} + if ( !class_exists( 'AutoLoader' ) ) { require_once( "$IP/includes/AutoLoader.php" ); }