Changeset 2143

Show
Ignore:
Timestamp:
02/22/2008 01:23:19 PM (9 months ago)
Author:
Geert
Message:

Various small cleanups

Location:
trunk/system
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/core/Kohana.php

    r2142 r2143  
    894894         * @return  boolean  all tests 
    895895         */ 
    896         public static function user_agent($key, $compare = NULL) 
     896        public static function user_agent($key = 'agent', $compare = NULL) 
    897897        { 
    898898                static $info; 
     
    911911                                        if (stripos(Kohana::$user_agent, $agent) !== FALSE) 
    912912                                        { 
    913                                                 if ($type === 'browser' AND preg_match('|'.preg_quote($agent).'[^0-9.]*([0-9.]+)|i', Kohana::$user_agent, $match)) 
     913                                                if ($type === 'browser' AND preg_match('|'.preg_quote($agent).'[^0-9.]*+([0-9.]+)|i', Kohana::$user_agent, $match)) 
    914914                                                { 
    915915                                                        // Set the browser version 
     
    991991 
    992992                // Return the key, if set 
    993                 return isset($info[$key]) ? $info[$key] : NULL; 
     993                return (isset($info[$key])) ? $info[$key] : NULL; 
    994994        } 
    995995 
  • trunk/system/libraries/Pagination.php

    r2139 r2143  
    9696                $this->items_per_page     = (int) max(1, $this->items_per_page); 
    9797                $this->total_pages        = (int) ceil($this->total_items / $this->items_per_page); 
    98                 $this->current_page       = (int) min(max(1, Kohana::$instance->uri->segment($this->uri_segment)), max(1, $this->total_pages)); 
     98                $this->current_page       = (int) min(max(1, URI::instance()->segment($this->uri_segment)), max(1, $this->total_pages)); 
    9999                $this->current_first_item = (int) min((($this->current_page - 1) * $this->items_per_page) + 1, $this->total_items); 
    100100                $this->current_last_item  = (int) min($this->current_first_item + $this->items_per_page - 1, $this->total_items); 
  • trunk/system/libraries/Session.php

    r2138 r2143  
    5555                        self::$protect = array_combine(self::$protect, self::$protect); 
    5656 
    57                         if (self::$config['driver'] != 'native') 
     57                        if (self::$config['driver'] !== 'native') 
    5858                        { 
    5959                                // Set driver name 
  • trunk/system/libraries/Validation.php

    r2088 r2143  
    546546                foreach ($fields as $depends_on) 
    547547                { 
    548                         if (! isset($this[$depends_on]) OR $this[$depends_on] == NULL) 
     548                        if ( ! isset($this[$depends_on]) OR $this[$depends_on] == NULL) 
    549549                                return FALSE; 
    550550                }