From b44f8b296bb5096e6c7a3053479b58d3edb8b784 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 25 Dec 2012 00:26:26 -0800 Subject: [PATCH] Made wfBaseconvert actually work with $lowercase=false. * This used to return false for any non-digit input characters. Change-Id: Ie7fca2669724dea29f4733bbc77a559d4f48a5b1 --- includes/GlobalFunctions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ); } -- 2.20.1