Changeset 2159

Show
Ignore:
Timestamp:
02/24/08 10:34:30 (5 months ago)
Author:
Geert
Message:
  • Modified Kohana::debug() to also show the variable type because print_r() alone will for example output "1" in case of a boolean or completely nothing in case of a NULL value.
  • Other small cleanups
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/modules/auth/controllers/auth.php

    r2093 r2159  
    7979                                if ($this->auth->login($user, $form->password->value)) 
    8080                                { 
    81                                         echo "<h4>Login Success!</h4>"
    82                                         echo "<p>Your roles are:</p>"
     81                                        echo '<h4>Login Success!</h4>'
     82                                        echo '<p>Your roles are:</p>'
    8383                                        echo Kohana::debug($user->roles); 
    8484                                        return; 
  • trunk/system/core/Kohana.php

    r2155 r2159  
    10101010                foreach($params as $var) 
    10111011                { 
    1012                         $output[] = '<pre>'.html::specialchars(print_r($var, TRUE)).'</pre>'; 
     1012                        $output[] = '<pre>('.gettype($var).') '.html::specialchars(print_r($var, TRUE)).'</pre>'; 
    10131013                } 
    10141014 
     
    10681068                                        } 
    10691069 
    1070                                         $temp .= $sep.print_r($arg, TRUE); 
     1070                                        $temp .= $sep.html::specialchars(print_r($arg, TRUE)); 
    10711071 
    10721072                                        // Change separator to a comma 
  • trunk/system/libraries/Validation.php

    r2143 r2159  
    135135                        throw new Kohana_Exception('validation.filter_not_callable'); 
    136136 
    137                 $filter = (is_string($filter) AND strpos($filter, '::') !== FALSE) ? explode('::', $filter) : $filter;                  
     137                $filter = (is_string($filter) AND strpos($filter, '::') !== FALSE) ? explode('::', $filter) : $filter; 
    138138 
    139139                if ($field === TRUE) 
     
    279279                                throw new Kohana_Exception('validation.callback_not_callable'); 
    280280 
    281                         $callback = (is_string($callback) AND strpos($callback, '::') !== FALSE) ? explode('::', $callback) : $callback;                                                        
    282  
    283                         // Add the filter to specified field 
     281                        $callback = (is_string($callback) AND strpos($callback, '::') !== FALSE) ? explode('::', $callback) : $callback; 
     282 
     283                        // Add the callback to specified field 
    284284                        $this->callbacks[$field][] = $callback; 
    285285                }