Show
Ignore:
Timestamp:
11/19/06 07:56:05 (2 years ago)
Author:
ryan
Message:

Remove trailing spaces and convert spaces to tabs. Props Nazgul. fixes #986

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/compat.php

    r3901 r4495  
    3737 
    3838function printr($var, $do_not_echo = false) { 
    39     // from php.net/print_r user contributed notes  
     39    // from php.net/print_r user contributed notes 
    4040    ob_start(); 
    4141    print_r($var); 
     
    4343    ob_clean(); 
    4444    if (!$do_not_echo) { 
    45       echo "<pre>$code</pre>"; 
     45       echo "<pre>$code</pre>"; 
    4646    } 
    4747    ob_end_clean(); 
     
    5858 
    5959if (!defined('CASE_LOWER')) { 
    60     define('CASE_LOWER', 0); 
     60       define('CASE_LOWER', 0); 
    6161} 
    6262 
    6363if (!defined('CASE_UPPER')) { 
    64     define('CASE_UPPER', 1); 
     64       define('CASE_UPPER', 1); 
    6565} 
    6666 
     
    7979 */ 
    8080if (!function_exists('array_change_key_case')) { 
    81     function array_change_key_case($input, $case = CASE_LOWER) 
    82    
    83         if (!is_array($input)) { 
    84             user_error('array_change_key_case(): The argument should be an array', 
    85                 E_USER_WARNING); 
    86             return false; 
    87        
     81       function array_change_key_case($input, $case = CASE_LOWER) 
     82       
     83               if (!is_array($input)) { 
     84                       user_error('array_change_key_case(): The argument should be an array', 
     85                               E_USER_WARNING); 
     86                       return false; 
     87               
    8888 
    89         $output   = array (); 
    90         $keys     = array_keys($input); 
    91         $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper'; 
     89               $output   = array (); 
     90               $keys     = array_keys($input); 
     91               $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper'; 
    9292 
    93         foreach ($keys as $key) { 
    94             $output[$casefunc($key)] = $input[$key]; 
    95        
     93               foreach ($keys as $key) { 
     94                       $output[$casefunc($key)] = $input[$key]; 
     95               
    9696 
    97         return $output; 
    98    
     97               return $output; 
     98       
    9999} 
    100100 
    101101// From php.net 
    102102if(!function_exists('http_build_query')) { 
    103   function http_build_query( $formdata, $numeric_prefix = null, $key = null ) { 
    104       $res = array(); 
    105       foreach ((array)$formdata as $k=>$v) { 
    106           $tmp_key = urlencode(is_int($k) ? $numeric_prefix.$k : $k); 
    107           if ($key) $tmp_key = $key.'['.$tmp_key.']'; 
    108           $res[] = ( ( is_array($v) || is_object($v) ) ? http_build_query($v, null, $tmp_key) : $tmp_key."=".urlencode($v) ); 
    109      
    110       $separator = ini_get('arg_separator.output'); 
    111       return implode($separator, $res); 
    112  
     103    function http_build_query( $formdata, $numeric_prefix = null, $key = null ) { 
     104            $res = array(); 
     105            foreach ((array)$formdata as $k=>$v) { 
     106                    $tmp_key = urlencode(is_int($k) ? $numeric_prefix.$k : $k); 
     107                    if ($key) $tmp_key = $key.'['.$tmp_key.']'; 
     108                    $res[] = ( ( is_array($v) || is_object($v) ) ? http_build_query($v, null, $tmp_key) : $tmp_key."=".urlencode($v) ); 
     109           
     110            $separator = ini_get('arg_separator.output'); 
     111            return implode($separator, $res); 
     112   
    113113} 
    114114