to plain class names, using the 'factory' key in the module description
array. This allows dependency injection to be used for ResourceLoader modules.
* $wgExceptionHooks has been removed.
+* $wgShellLocale is now applied for all requests. wfInitShellLocale() is
+ deprecated and a no-op, as it is no longer needed.
=== New features in 1.30 ===
* (T37247) Output from Parser::parse() will now be wrapped in a div with
* @note If multiple wikis are being served from the same process (e.g. the
* same fastCGI or Apache server), this setting must be the same on all those
* wikis.
- * @see wfInitShellLocale()
*/
$wgShellLocale = 'C.UTF-8';
* @return string
*/
function wfEscapeShellArg( /*...*/ ) {
- wfInitShellLocale();
-
$args = func_get_args();
if ( count( $args ) === 1 && is_array( reset( $args ) ) ) {
// If only one argument has been passed, and that argument is an array,
$includeStderr = isset( $options['duplicateStderr'] ) && $options['duplicateStderr'];
$profileMethod = isset( $options['profileMethod'] ) ? $options['profileMethod'] : wfGetCaller();
- wfInitShellLocale();
-
$envcmd = '';
foreach ( $environ as $k => $v ) {
if ( wfIsWindows() ) {
}
/**
- * Set the locale for locale-sensitive operations
+ * Formerly set the locale for locale-sensitive operations
*
- * Sets LC_ALL to a known value to work around issues like the following:
- * - https://bugs.php.net/bug.php?id=45132 escapeshellarg() destroys non-ASCII
- * characters if LANG is not a UTF-8 locale
- * - T107128 Scribunto string comparison works case insensitive while the
- * standard Lua case sensitive
+ * This is now done in Setup.php.
*
+ * @deprecated since 1.30, no longer needed
* @see $wgShellLocale
*/
function wfInitShellLocale() {
- static $done = false;
- if ( $done ) {
- return;
- }
- $done = true;
- global $wgShellLocale;
- putenv( "LC_ALL=$wgShellLocale" );
- setlocale( LC_ALL, $wgShellLocale );
}
/**
mb_internal_encoding( 'UTF-8' );
+// Set the configured locale on all requests for consisteny
+putenv( "LC_ALL=$wgShellLocale" );
+setlocale( LC_ALL, $wgShellLocale );
+
// Set various default paths sensibly...
$ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' );