Merge "Clear shallowFallbacks in LocalisationCache::unload"
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 78fcb8b..4f9347a 100644 (file)
@@ -1001,7 +1001,7 @@ function wfDebugLog( $logGroup, $text, $public = true ) {
                        wfErrorLog( "$time $host $wiki: $text", $wgDebugLogGroups[$logGroup] );
                }
        } elseif ( $public === true ) {
-               wfDebug( "[$logGroup] $text", true );
+               wfDebug( "[$logGroup] $text", false );
        }
 }
 
@@ -2593,11 +2593,11 @@ function in_string( $needle, $str, $insensitive = false ) {
  * @return Bool
  */
 function wfIniGetBool( $setting ) {
-       $val = ini_get( $setting );
+       $val = strtolower( ini_get( $setting ) );
        // 'on' and 'true' can't have whitespace around them, but '1' can.
-       return strtolower( $val ) == 'on'
-               || strtolower( $val ) == 'true'
-               || strtolower( $val ) == 'yes'
+       return $val == 'on'
+               || $val == 'true'
+               || $val == 'yes'
                || preg_match( "/^\s*[+-]?0*[1-9]/", $val ); // approx C atoi() function
 }
 
@@ -3750,22 +3750,17 @@ function wfBCP47( $code ) {
        $codeSegment = explode( '-', $code );
        $codeBCP = array();
        foreach ( $codeSegment as $segNo => $seg ) {
-               if ( count( $codeSegment ) > 0 ) {
-                       // when previous segment is x, it is a private segment and should be lc
-                       if ( $segNo > 0 && strtolower( $codeSegment[( $segNo - 1 )] ) == 'x' ) {
-                               $codeBCP[$segNo] = strtolower( $seg );
-                       // ISO 3166 country code
-                       } elseif ( ( strlen( $seg ) == 2 ) && ( $segNo > 0 ) ) {
-                               $codeBCP[$segNo] = strtoupper( $seg );
-                       // ISO 15924 script code
-                       } elseif ( ( strlen( $seg ) == 4 ) && ( $segNo > 0 ) ) {
-                               $codeBCP[$segNo] = ucfirst( strtolower( $seg ) );
-                       // Use lowercase for other cases
-                       } else {
-                               $codeBCP[$segNo] = strtolower( $seg );
-                       }
+               // when previous segment is x, it is a private segment and should be lc
+               if ( $segNo > 0 && strtolower( $codeSegment[( $segNo - 1 )] ) == 'x' ) {
+                       $codeBCP[$segNo] = strtolower( $seg );
+               // ISO 3166 country code
+               } elseif ( ( strlen( $seg ) == 2 ) && ( $segNo > 0 ) ) {
+                       $codeBCP[$segNo] = strtoupper( $seg );
+               // ISO 15924 script code
+               } elseif ( ( strlen( $seg ) == 4 ) && ( $segNo > 0 ) ) {
+                       $codeBCP[$segNo] = ucfirst( strtolower( $seg ) );
+               // Use lowercase for other cases
                } else {
-               // Use lowercase for single segment
                        $codeBCP[$segNo] = strtolower( $seg );
                }
        }