r20374 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20373‎ | r20374 | r20375 >
Date:20:55, 12 March 2007
Author:aaron
Status:old
Tags:
Comment:
*Add case option to base convert
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1996,7 +1996,8 @@
19971997 * @param $pad int 1 or greater
19981998 * @return string or false on invalid input
19991999 */
2000 -function wfBaseConvert( $input, $sourceBase, $destBase, $pad=1 ) {
 2000+function wfBaseConvert( $input, $sourceBase, $destBase, $pad=1, $lowercase=true ) {
 2001+ $input = strval( $input );
20012002 if( $sourceBase < 2 ||
20022003 $sourceBase > 36 ||
20032004 $destBase < 2 ||
@@ -2009,8 +2010,7 @@
20102011 $input == '' ) {
20112012 return false;
20122013 }
2013 -
2014 - $digitChars = '0123456789abcdefghijklmnopqrstuvwxyz';
 2014+ $digitChars = ( $lowercase ) ? '0123456789abcdefghijklmnopqrstuvwxyz' : '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
20152015 $inDigits = array();
20162016 $outChars = '';
20172017