Changeset 2631

Show
Ignore:
Timestamp:
05/05/08 11:56:22 (4 months ago)
Author:
Shadowhand
Message:

Updated Validation to use arr::map_recursive(), since array_walk_recursive() is poop and doesn't work at all.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Validation.php

    r2626 r2631  
    402402                    { 
    403403                        // Process each filter 
    404                         if (is_array($this[$f])) 
    405                         { 
    406                             array_walk_recursive($this[$f], $func); 
    407                         } 
    408                         else 
    409                         { 
    410                             $this[$f] = call_user_func($func, $this[$f]); 
    411                         } 
     404                        $this[$f] = is_array($this[$f]) ? arr::map_recursive($func, $this[$f]) : call_user_func($func, $this[$f]); 
    412405                    } 
    413406                } 
     
    415408                { 
    416409                    // Process each filter 
    417                     if (is_array($this[$field])) 
    418                     { 
    419                         array_walk_recursive($this[$field], $func); 
    420                     } 
    421                     else 
    422                     { 
    423                         $this[$field] = call_user_func($func, $this[$field]); 
    424                     } 
     410                    $this[$field] = is_array($this[$field]) ? arr::map_recursive($func, $this[$field]) : call_user_func($func, $this[$field]); 
    425411                } 
    426412            }