[wp-cvs] wordpress/wp-includes functions-compat.php,1.1,1.2

Matthew Mullenweg saxmatt at users.sourceforge.net
Fri Feb 11 00:57:48 GMT 2005


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10175/wp-includes

Modified Files:
	functions-compat.php 
Log Message:
Keep working with 4.1 - http://mosquito.wordpress.org/view.php?id=808

Index: functions-compat.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions-compat.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** functions-compat.php	11 Oct 2004 13:17:12 -0000	1.1
--- functions-compat.php	11 Feb 2005 00:57:46 -0000	1.2
***************
*** 48,50 ****
--- 48,92 ----
  }
  
+ if (!defined('CASE_LOWER')) {
+     define('CASE_LOWER', 0);
+ }
+ 
+ if (!defined('CASE_UPPER')) {
+     define('CASE_UPPER', 1);
+ }
+ 
+ 
+ /**
+  * Replace array_change_key_case()
+  *
+  * @category    PHP
+  * @package     PHP_Compat
+  * @link        http://php.net/function.array_change_key_case
+  * @author      Stephan Schmidt <schst at php.net>
+  * @author      Aidan Lister <aidan at php.net>
+  * @version     $Revision$
+  * @since       PHP 4.2.0
+  * @require     PHP 4.0.0 (user_error)
+  */
+ if (!function_exists('array_change_key_case')) {
+     function array_change_key_case($input, $case = CASE_LOWER)
+     {
+         if (!is_array($input)) {
+             user_error('array_change_key_case(): The argument should be an array',
+                 E_USER_WARNING);
+             return false;
+         }
+ 
+         $output   = array ();
+         $keys     = array_keys($input);
+         $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper';
+ 
+         foreach ($keys as $key) {
+             $output[$casefunc($key)] = $input[$key];
+         }
+ 
+         return $output;
+     }
+ }
+ 
  ?>
\ No newline at end of file



More information about the cvs mailing list