Workaround for PHP 5.2.6 escapeshellcmd()/escapeshellarg() bug
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 8 Aug 2008 03:32:54 +0000 (03:32 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 8 Aug 2008 03:32:54 +0000 (03:32 +0000)
includes/Setup.php

index cf8aa9b..2700877 100644 (file)
@@ -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" );
 }