From 6e0d253f6d1ec93732f14f5bbe04f67bc7524725 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 8 Aug 2008 03:32:54 +0000 Subject: [PATCH] Workaround for PHP 5.2.6 escapeshellcmd()/escapeshellarg() bug --- includes/Setup.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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" ); } -- 2.20.1