From: Aaron Schulz Date: Tue, 25 Dec 2012 08:26:26 +0000 (-0800) Subject: Made wfBaseconvert actually work with $lowercase=false. X-Git-Tag: 1.31.0-rc.0~21214 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=b44f8b296bb5096e6c7a3053479b58d3edb8b784;p=lhc%2Fweb%2Fwiklou.git Made wfBaseconvert actually work with $lowercase=false. * This used to return false for any non-digit input characters. Change-Id: Ie7fca2669724dea29f4733bbc77a559d4f48a5b1 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 9779cb8b69..208befe8fa 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3200,7 +3200,7 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = t $input == '' ) { return false; } - $digitChars = ( $lowercase ) ? '0123456789abcdefghijklmnopqrstuvwxyz' : '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $digitChars = '0123456789abcdefghijklmnopqrstuvwxyz'; $inDigits = array(); $outChars = ''; @@ -3256,6 +3256,10 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = t $outChars .= '0'; } + if ( !$lowercase ) { + $outChars = strtoupper( $outChars ); + } + return strrev( $outChars ); }