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

Various small cleanups

Files:
1 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