Changeset 2143 for trunk/system/core/Kohana.php
- Timestamp:
- 02/22/2008 01:23:19 PM (11 months ago)
- Files:
-
- 1 modified
-
trunk/system/core/Kohana.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Kohana.php
r2142 r2143 894 894 * @return boolean all tests 895 895 */ 896 public static function user_agent($key , $compare = NULL)896 public static function user_agent($key = 'agent', $compare = NULL) 897 897 { 898 898 static $info; … … 911 911 if (stripos(Kohana::$user_agent, $agent) !== FALSE) 912 912 { 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)) 914 914 { 915 915 // Set the browser version … … 991 991 992 992 // Return the key, if set 993 return isset($info[$key]) ? $info[$key] : NULL;993 return (isset($info[$key])) ? $info[$key] : NULL; 994 994 } 995 995
