Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1996,7 +1996,8 @@ |
1997 | 1997 | * @param $pad int 1 or greater |
1998 | 1998 | * @return string or false on invalid input |
1999 | 1999 | */ |
2000 | | -function wfBaseConvert( $input, $sourceBase, $destBase, $pad=1 ) { |
| 2000 | +function wfBaseConvert( $input, $sourceBase, $destBase, $pad=1, $lowercase=true ) { |
| 2001 | + $input = strval( $input ); |
2001 | 2002 | if( $sourceBase < 2 || |
2002 | 2003 | $sourceBase > 36 || |
2003 | 2004 | $destBase < 2 || |
— | — | @@ -2009,8 +2010,7 @@ |
2010 | 2011 | $input == '' ) { |
2011 | 2012 | return false; |
2012 | 2013 | } |
2013 | | - |
2014 | | - $digitChars = '0123456789abcdefghijklmnopqrstuvwxyz'; |
| 2014 | + $digitChars = ( $lowercase ) ? '0123456789abcdefghijklmnopqrstuvwxyz' : '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
2015 | 2015 | $inDigits = array(); |
2016 | 2016 | $outChars = ''; |
2017 | 2017 | |