Property changes on: branches/REL1_13/phase3/skins/common/images/cyrl/button_link.png |
___________________________________________________________________ |
Name: svn:mergeinfo |
1 | 1 | - |
Property changes on: branches/REL1_13/phase3/skins/common/images/cyrl |
___________________________________________________________________ |
Name: svn:mergeinfo |
2 | 2 | - |
Index: branches/REL1_13/phase3/includes/GlobalFunctions.php |
— | — | @@ -1074,9 +1074,14 @@ |
1075 | 1075 | /** |
1076 | 1076 | * Windows-compatible version of escapeshellarg() |
1077 | 1077 | * Windows doesn't recognise single-quotes in the shell, but the escapeshellarg() |
1078 | | - * function puts single quotes in regardless of OS |
| 1078 | + * function puts single quotes in regardless of OS. |
| 1079 | + * |
| 1080 | + * Also fixes the locale problems on Linux in PHP 5.2.6+ (bug backported to |
| 1081 | + * earlier distro releases of PHP) |
1079 | 1082 | */ |
1080 | 1083 | function wfEscapeShellArg( ) { |
| 1084 | + wfInitShellLocale(); |
| 1085 | + |
1081 | 1086 | $args = func_get_args(); |
1082 | 1087 | $first = true; |
1083 | 1088 | $retVal = ''; |
— | — | @@ -2000,6 +2005,7 @@ |
2001 | 2006 | $retval = 1; |
2002 | 2007 | return "Unable to run external programs in safe mode."; |
2003 | 2008 | } |
| 2009 | + wfInitShellLocale(); |
2004 | 2010 | |
2005 | 2011 | if ( php_uname( 's' ) == 'Linux' ) { |
2006 | 2012 | $time = intval( ini_get( 'max_execution_time' ) ); |
— | — | @@ -2025,7 +2031,21 @@ |
2026 | 2032 | $output = ob_get_contents(); |
2027 | 2033 | ob_end_clean(); |
2028 | 2034 | return $output; |
| 2035 | +} |
2029 | 2036 | |
| 2037 | +/** |
| 2038 | + * Workaround for http://bugs.php.net/bug.php?id=45132 |
| 2039 | + * escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale |
| 2040 | + */ |
| 2041 | +function wfInitShellLocale() { |
| 2042 | + static $done = false; |
| 2043 | + if ( $done ) return; |
| 2044 | + $done = true; |
| 2045 | + global $wgShellLocale; |
| 2046 | + if ( !wfIniGetBool( 'safe_mode' ) ) { |
| 2047 | + putenv( "LC_CTYPE=$wgShellLocale" ); |
| 2048 | + setlocale( LC_CTYPE, $wgShellLocale ); |
| 2049 | + } |
2030 | 2050 | } |
2031 | 2051 | |
2032 | 2052 | /** |
Index: branches/REL1_13/phase3/includes/Setup.php |
— | — | @@ -113,14 +113,6 @@ |
114 | 114 | ); |
115 | 115 | } |
116 | 116 | } |
117 | | - |
118 | | -/** |
119 | | - * Workaround for http://bugs.php.net/bug.php?id=45132 |
120 | | - * escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale |
121 | | - */ |
122 | | -putenv( 'LC_CTYPE=en_US.UTF-8' ); |
123 | | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
124 | | - |
125 | 117 | if ( !class_exists( 'AutoLoader' ) ) { |
126 | 118 | require_once( "$IP/includes/AutoLoader.php" ); |
127 | 119 | } |
Index: branches/REL1_13/phase3/includes/DefaultSettings.php |
— | — | @@ -778,6 +778,13 @@ |
779 | 779 | $wgEditEncoding = ''; |
780 | 780 | |
781 | 781 | /** |
| 782 | + * Locale for LC_CTYPE, to work around http://bugs.php.net/bug.php?id=45132 |
| 783 | + * For Unix-like operating systems, set this to to a locale that has a UTF-8 |
| 784 | + * character set. Only the character set is relevant. |
| 785 | + */ |
| 786 | +$wgShellLocale = 'en_US.utf8'; |
| 787 | + |
| 788 | +/** |
782 | 789 | * Set this to eg 'ISO-8859-1' to perform character set |
783 | 790 | * conversion when loading old revisions not marked with |
784 | 791 | * "utf-8" flag. Use this when converting wiki to UTF-8 |
Index: branches/REL1_13/phase3/config/index.php |
— | — | @@ -598,7 +598,6 @@ |
599 | 599 | $conf->RootPW = importPost( "RootPW", "" ); |
600 | 600 | $useRoot = importCheck( 'useroot', false ); |
601 | 601 | $conf->LanguageCode = importPost( "LanguageCode", "en" ); |
602 | | - |
603 | 602 | ## MySQL specific: |
604 | 603 | $conf->DBprefix = importPost( "DBprefix" ); |
605 | 604 | $conf->setSchema( |
— | — | @@ -617,6 +616,7 @@ |
618 | 617 | // We need a second field so it doesn't overwrite the MySQL one |
619 | 618 | $conf->DBprefix2 = importPost( "DBprefix2" ); |
620 | 619 | |
| 620 | + $conf->ShellLocale = getShellLocale( $conf->LanguageCode ); |
621 | 621 | |
622 | 622 | /* Check for validity */ |
623 | 623 | $errs = array(); |
— | — | @@ -1521,6 +1521,13 @@ |
1522 | 1522 | $rights = ($conf->RightsUrl) ? "" : "# "; |
1523 | 1523 | $hashedUploads = $conf->safeMode ? '' : '# '; |
1524 | 1524 | |
| 1525 | + if ( $conf->ShellLocale ) { |
| 1526 | + $locale = ''; |
| 1527 | + } else { |
| 1528 | + $locale = '# '; |
| 1529 | + $conf->ShellLocale = 'en_US.UTF-8'; |
| 1530 | + } |
| 1531 | + |
1525 | 1532 | switch ( $conf->Shm ) { |
1526 | 1533 | case 'memcached': |
1527 | 1534 | $cacheType = 'CACHE_MEMCACHED'; |
— | — | @@ -1692,6 +1699,11 @@ |
1693 | 1700 | {$magic}\$wgUseImageMagick = true; |
1694 | 1701 | {$magic}\$wgImageMagickConvertCommand = \"{$convert}\"; |
1695 | 1702 | |
| 1703 | +## If you use ImageMagick (or any other shell command) on a |
| 1704 | +## Linux server, this will need to be set to the name of an |
| 1705 | +## available UTF-8 locale |
| 1706 | +{$locale}\$wgShellLocale = \"{$slconf['ShellLocale']}\"; |
| 1707 | + |
1696 | 1708 | ## If you want to use image uploads under safe mode, |
1697 | 1709 | ## create the directories images/archive, images/thumb and |
1698 | 1710 | ## images/temp, and make them all writable. Then uncomment |
— | — | @@ -1934,6 +1946,71 @@ |
1935 | 1947 | print "<li>$item</li>"; |
1936 | 1948 | } |
1937 | 1949 | |
| 1950 | +# Determine a suitable value for $wgShellLocale |
| 1951 | +function getShellLocale( $wikiLanguage ) { |
| 1952 | + # Give up now if we're in safe mode or open_basedir |
| 1953 | + # It's theoretically possible but tricky to work with |
| 1954 | + if ( wfIniGetBool( "safe_mode" ) || ini_get( 'open_basedir' ) ) { |
| 1955 | + return false; |
| 1956 | + } |
| 1957 | + |
| 1958 | + $os = php_uname( 's' ); |
| 1959 | + $supported = array( 'Linux', 'SunOS', 'HP-UX' ); # Tested these |
| 1960 | + if ( !in_array( $os, $supported ) ) { |
| 1961 | + return false; |
| 1962 | + } |
| 1963 | + |
| 1964 | + # Get a list of available locales |
| 1965 | + $lines = $ret = false; |
| 1966 | + exec( '/usr/bin/locale -a', $lines, $ret ); |
| 1967 | + if ( $ret ) { |
| 1968 | + return false; |
| 1969 | + } |
| 1970 | + |
| 1971 | + $lines = array_map( 'trim', $lines ); |
| 1972 | + $candidatesByLocale = array(); |
| 1973 | + $candidatesByLang = array(); |
| 1974 | + foreach ( $lines as $line ) { |
| 1975 | + if ( $line === '' ) { |
| 1976 | + continue; |
| 1977 | + } |
| 1978 | + if ( !preg_match( '/^([a-zA-Z]+)(_[a-zA-Z]+|)\.(utf8|UTF-8)(@[a-zA-Z_]*|)$/i', $line, $m ) ) { |
| 1979 | + continue; |
| 1980 | + } |
| 1981 | + list( $all, $lang, $territory, $charset, $modifier ) = $m; |
| 1982 | + $candidatesByLocale[$m[0]] = $m; |
| 1983 | + $candidatesByLang[$lang][] = $m; |
| 1984 | + } |
| 1985 | + |
| 1986 | + # Try the current value of LANG |
| 1987 | + if ( isset( $candidatesByLocale[ getenv( 'LANG' ) ] ) ) { |
| 1988 | + return getenv( 'LANG' ); |
| 1989 | + } |
| 1990 | + |
| 1991 | + # Try the most common ones |
| 1992 | + $commonLocales = array( 'en_US.UTF-8', 'en_US.utf8', 'de_DE.UTF-8', 'de_DE.utf8' ); |
| 1993 | + foreach ( $commonLocales as $commonLocale ) { |
| 1994 | + if ( isset( $candidatesByLocale[$commonLocale] ) ) { |
| 1995 | + return $commonLocale; |
| 1996 | + } |
| 1997 | + } |
| 1998 | + |
| 1999 | + # Is there an available locale in the Wiki's language? |
| 2000 | + if ( isset( $candidatesByLang[$wikiLang] ) ) { |
| 2001 | + $m = reset( $candidatesByLang[$wikiLang] ); |
| 2002 | + return $m[0]; |
| 2003 | + } |
| 2004 | + |
| 2005 | + # Are there any at all? |
| 2006 | + if ( count( $candidatesByLocale ) ) { |
| 2007 | + $m = reset( $candidatesByLocale ); |
| 2008 | + return $m[0]; |
| 2009 | + } |
| 2010 | + |
| 2011 | + # Give up |
| 2012 | + return false; |
| 2013 | +} |
| 2014 | + |
1938 | 2015 | ?> |
1939 | 2016 | |
1940 | 2017 | <div class="license"> |
Index: branches/REL1_13/phase3/RELEASE-NOTES |
— | — | @@ -4,13 +4,9 @@ |
5 | 5 | setting since version 1.2.0. If you have it on, turn it *off* if you can. |
6 | 6 | |
7 | 7 | == MediaWiki 1.13.2 == |
8 | | -* Security: Work around misconfiguration by requiring strict comparisons for |
9 | | - in_array in User::isAllowed(). |
10 | 8 | |
11 | | -== MediaWiki 1.13.1 == |
| 9 | +October 2, 2008 |
12 | 10 | |
13 | | -September 6, 2008 |
14 | | - |
15 | 11 | This is a bugfix release of the Summer 2008 snapshot release of MediaWiki. |
16 | 12 | |
17 | 13 | MediaWiki is now using a "continuous integration" development model with |
— | — | @@ -24,6 +20,13 @@ |
25 | 21 | Those wishing to use the latest code instead of a branch release can obtain |
26 | 22 | it from source control: http://www.mediawiki.org/wiki/Download_from_SVN |
27 | 23 | |
| 24 | +== Changes since 1.13.1 == |
| 25 | + |
| 26 | +* Security: Work around misconfiguration by requiring strict comparisons for |
| 27 | + in_array in User::isAllowed(). |
| 28 | +* (bug 14944) Detection of an appropriate locale to use for LC_CTYPE during |
| 29 | + shell invocation. For servers that don't have en_US.UTF-8. |
| 30 | + |
28 | 31 | == Changes since 1.13.0 |
29 | 32 | |
30 | 33 | * (bug 15460) Fixed intermittent deadlock errors and poor concurrent |
Property changes on: branches/REL1_13/phase3 |
___________________________________________________________________ |
Name: svn:mergeinfo |
31 | 34 | + /trunk/phase3:41379-41380 |