From e90580ee6f97e4be0141679447b0aaec3a0081ea Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 2 Oct 2008 23:23:21 +0200 Subject: Update auf 1.13.2 --- includes/DefaultSettings.php | 11 +++++++++-- includes/GlobalFunctions.php | 22 +++++++++++++++++++++- includes/Setup.php | 8 -------- includes/SkinTemplate.php | 4 +--- includes/User.php | 4 +++- 5 files changed, 34 insertions(+), 15 deletions(-) (limited to 'includes') diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5b7e7d9d..d1d04a45 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -31,7 +31,7 @@ require_once( "$IP/includes/SiteConfiguration.php" ); $wgConf = new SiteConfiguration; /** MediaWiki version number */ -$wgVersion = '1.13.1'; +$wgVersion = '1.13.2'; /** Name of the site. It must be changed in LocalSettings.php */ $wgSitename = 'MediaWiki'; @@ -777,6 +777,13 @@ $wgInputEncoding = 'UTF-8'; $wgOutputEncoding = 'UTF-8'; $wgEditEncoding = ''; +/** + * Locale for LC_CTYPE, to work around http://bugs.php.net/bug.php?id=45132 + * For Unix-like operating systems, set this to to a locale that has a UTF-8 + * character set. Only the character set is relevant. + */ +$wgShellLocale = 'en_US.utf8'; + /** * Set this to eg 'ISO-8859-1' to perform character set * conversion when loading old revisions not marked with @@ -2281,7 +2288,7 @@ $wgAutoloadClasses = array(); * $wgExtensionCredits[$type][] = array( * 'name' => 'Example extension', * 'version' => 1.9, - * 'svn-revision' => '$LastChangedRevision: 40539 $', + * 'svn-revision' => '$LastChangedRevision: 41545 $', * 'author' => 'Foo Barstein', * 'url' => 'http://wwww.example.com/Example%20Extension/', * 'description' => 'An example extension', diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index f5a2660c..26401bb4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1074,9 +1074,14 @@ function wfPurgeSquidServers ($urlArr) { /** * Windows-compatible version of escapeshellarg() * Windows doesn't recognise single-quotes in the shell, but the escapeshellarg() - * function puts single quotes in regardless of OS + * function puts single quotes in regardless of OS. + * + * Also fixes the locale problems on Linux in PHP 5.2.6+ (bug backported to + * earlier distro releases of PHP) */ function wfEscapeShellArg( ) { + wfInitShellLocale(); + $args = func_get_args(); $first = true; $retVal = ''; @@ -2000,6 +2005,7 @@ function wfShellExec( $cmd, &$retval=null ) { $retval = 1; return "Unable to run external programs in safe mode."; } + wfInitShellLocale(); if ( php_uname( 's' ) == 'Linux' ) { $time = intval( ini_get( 'max_execution_time' ) ); @@ -2025,7 +2031,21 @@ function wfShellExec( $cmd, &$retval=null ) { $output = ob_get_contents(); ob_end_clean(); return $output; +} +/** + * Workaround for http://bugs.php.net/bug.php?id=45132 + * escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale + */ +function wfInitShellLocale() { + static $done = false; + if ( $done ) return; + $done = true; + global $wgShellLocale; + if ( !wfIniGetBool( 'safe_mode' ) ) { + putenv( "LC_CTYPE=$wgShellLocale" ); + setlocale( LC_CTYPE, $wgShellLocale ); + } } /** diff --git a/includes/Setup.php b/includes/Setup.php index 877ea766..36c4d965 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -113,14 +113,6 @@ 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 - */ -putenv( 'LC_CTYPE=en_US.UTF-8' ); -setlocale( LC_CTYPE, 'en_US.UTF-8' ); - if ( !class_exists( 'AutoLoader' ) ) { require_once( "$IP/includes/AutoLoader.php" ); } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c60cfb4e..506d1024 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -999,9 +999,7 @@ class SkinTemplate extends Skin { # If we use the site's dynamic CSS, throw that in, too if ( $wgUseSiteCss ) { $query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; - $skinquery = ''; - if (($us = $wgRequest->getVal('useskin', '')) !== '') - $skinquery = "&useskin=$us"; + $skinquery = "&useskin=" . urlencode( $this->getSkinName() ); $sitecss .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) . '";' . "\n"; $sitecss .= '@import "' . self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ) . '";' . "\n"; $sitecss .= '@import "' . self::makeUrl( '-', "action=raw&gen=css$siteargs$skinquery" ) . '";' . "\n"; diff --git a/includes/User.php b/includes/User.php index 5c129819..4e39d678 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1859,7 +1859,9 @@ class User { // In the spirit of DWIM return true; - return in_array( $action, $this->getRights() ); + # Use strict parameter to avoid matching numeric 0 accidentally inserted + # by misconfiguration: 0 == 'foo' + return in_array( $action, $this->getRights(), true ); } /** -- cgit v1.2.2