From 2f2700c0890be96b52d87b6291244c0bc8a1b828 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 12 Mar 2007 20:55:08 +0000 Subject: [PATCH] *Add case option to base convert --- includes/GlobalFunctions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 19eb4be087..c89bac3346 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1996,7 +1996,8 @@ function wfExplodeMarkup( $separator, $text ) { * @param $pad int 1 or greater * @return string or false on invalid input */ -function wfBaseConvert( $input, $sourceBase, $destBase, $pad=1 ) { +function wfBaseConvert( $input, $sourceBase, $destBase, $pad=1, $lowercase=true ) { + $input = strval( $input ); if( $sourceBase < 2 || $sourceBase > 36 || $destBase < 2 || @@ -2009,8 +2010,7 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad=1 ) { $input == '' ) { return false; } - - $digitChars = '0123456789abcdefghijklmnopqrstuvwxyz'; + $digitChars = ( $lowercase ) ? '0123456789abcdefghijklmnopqrstuvwxyz' : '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $inDigits = array(); $outChars = ''; -- 2.20.1