2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is KaiRo's userAgent detection.
17 * The Initial Developer of the Original Code is
18 * KaiRo - Robert Kaiser.
19 * Portions created by the Initial Developer are Copyright (C) 2003
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s): Robert Kaiser <kairo@kairo.at>
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
39 // userAgent PHP class
40 // get user agent and tell us what Browser is accessing
42 // function __construct([$ua_string])
43 // CONSTRUCTOR; reads UA string (or takes the optional given UA string) and gets info from that into our variables.
46 // the plain User Agent string
48 // the User Agent brand name
50 // the User Agent version
52 // bool: true if this agent is a bot
54 // array of static user agent data (static vars in functions are set for all objects of this class!)
56 // public function getBrand()
57 // returns the User Agent Brand Name
59 // public function getVersion()
60 // returns the User Agent version
62 // public function getAcceptLanguages()
63 // returns an associated array with the accepted languages of this UA
64 // keys are language codes, values are q factors (weights)
66 // public function getUAString()
67 // returns the full User Agent string
69 // public function getEngine()
70 // returns a string telling the detected rendering engine, null if we can't detect
71 // one of gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|icestorm|unknown
73 // public function hasEngine($rnd_engine)
74 // returns true if the given rendering engine was detected
76 // public function getEngineVersion()
77 // returns a the version number for the rendering engine
78 // this may be the same as getVersion() for many engines, or null if we don't know
80 // public function getOS()
81 // returns a string telling the detected operating system, null if we can't detect
82 // might be very verbose, uses no abbreviations for most names
84 // public function getPlatform()
85 // returns a string telling the detected OS platform, null if we can't detect
86 // one of windows|linux|mac|solaris|unknown
88 // public function getLanguage() {
89 // returns a string telling the detected browser UI language, null if we can't detect
90 // should be an ISO code
92 // public function isBot()
93 // returns true if User Agent seems to be a bot
95 // *** functions that only return useable info for some agents ***
97 // public function getGeckoDate()
98 // returns the Gecko date for Gecko-based browsers, null for others
100 // *** functions for compat to older versions of this class ***
102 // public function isns()
103 // returns true if User Agent seems to be Netscape brand, false if not
104 // public function isns4()
105 // returns true if User Agent seems to be Netscape Communicator 4.x, false if not
106 // public function isie()
107 // returns true if User Agent seems to be a version of Internet Exploder, false if not
108 // public function geckobased()
109 // returns true if User Agent seems to be a Gecko-based browser, false if not
110 // public function geckodate()
111 // returns the Gecko date when it's a Gecko-based browser, 0 if not
112 // public function khtmlbased()
113 // returns true if User Agent seems to be a KHTML-based browser, false if not
115 // collection of some known User Agent Strings:
116 // *** see testbed/ua_list_raw.txt ***
117 // *** see also http://www.pgts.com.au/pgtsj/pgtsj0208c.html ***
122 private $bot = false;
123 private $uadata = array();
125 function __construct($ua_string = '') {
126 // *** constructor ***
127 if (strlen($ua_string)) {
128 $this->uastring = $ua_string;
131 // read raw UA string
132 $this->uastring = $_SERVER['HTTP_USER_AGENT'];
135 // get UA brand and version
136 $this->brand = 'Unknown'; $this->version = null;
137 // find reasonable defaults
138 if (preg_match('|([0-9a-zA-Z\.:()_ -]+)/(\d[0-9a-zA-Z\._+-]*)|', $this->uastring, $regs)) {
139 $this->brand = trim($regs[1]);
140 $this->version = $regs[2];
142 elseif (preg_match('|^([a-zA-Z\._ -]+)[_ -][vV]?(\d[0-9a-zA-Z\.+]*)|', $this->uastring, $regs)) {
143 $this->brand = trim($regs[1]);
144 $this->version = $regs[2];
146 elseif (preg_match('|^([0-9a-zA-Z\._ -]+)|', $this->uastring, $regs)) {
147 $this->brand = trim($regs[1]);
148 $this->version = null;
150 $this->bot = (strpos(strtolower($this->brand), 'bot') !== false)
151 || (strpos(strtolower($this->brand), 'crawler') !== false)
152 || (strpos(strtolower($this->brand), 'spider') !== false)
153 || (strpos(strtolower($this->brand), 'search') !== false)
154 || (strpos(strtolower($this->brand), 'seek') !== false);
156 // search for any real and/or special UAs
157 if (preg_match('|Netscape6/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
158 $this->brand = 'Netscape';
159 $this->version = $regs[1];
162 elseif (preg_match('|Netscape/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
163 $this->brand = 'Netscape';
164 $this->version = $regs[1];
167 elseif (preg_match('|Chimera/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
168 $this->brand = 'Chimera';
169 $this->version = $regs[1];
172 elseif (preg_match('|Camino/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
173 $this->brand = 'Camino';
174 $this->version = $regs[1];
177 elseif (preg_match('|Phoenix/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
178 $this->brand = 'Phoenix';
179 $this->version = $regs[1];
182 elseif (preg_match('|Mozilla Firebird/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
183 $this->brand = 'Mozilla Firebird';
184 $this->version = $regs[1];
187 elseif (preg_match('|Flock/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
188 $this->brand = 'Flock';
189 $this->version = $regs[1];
192 elseif (preg_match('|Firefox/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
193 $this->brand = 'Firefox';
194 $this->version = $regs[1];
197 elseif (preg_match('|SeaMonkey/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
198 $this->brand = 'SeaMonkey';
199 $this->version = $regs[1];
202 elseif (preg_match('|Iceape/([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) {
203 $this->brand = 'IceApe';
204 $this->version = $regs[1];
207 elseif (preg_match('|Iceweasel/([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) {
208 $this->brand = 'IceWeasel';
209 $this->version = $regs[1];
212 elseif (preg_match('|Galeon/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
213 $this->brand = 'Galeon';
214 $this->version = $regs[1];
217 elseif (preg_match('|Epiphany/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
218 $this->brand = 'Epiphany';
219 $this->version = $regs[1];
222 elseif (preg_match('|K-Meleon/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
223 $this->brand = 'K-Meleon';
224 $this->version = $regs[1];
227 elseif (preg_match('|AOL[/ ]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
228 $this->brand = 'AOL';
229 $this->version = $regs[1];
232 elseif (preg_match('|rv:([0-9a-zA-Z\.+]+)|', $this->uastring, $regs) &&
233 strstr($this->uastring, "Mozilla/") && strstr($this->uastring, "Gecko/")) {
234 $this->brand = 'Mozilla';
235 $this->version = $regs[1];
238 elseif (preg_match('|m([0-9]+)\)|', $this->uastring, $regs) &&
239 strstr($this->uastring, "Mozilla/") && strstr($this->uastring, "Gecko/")) {
240 $this->brand = 'Mozilla';
241 $this->version = 'M'.$regs[1];
244 elseif (preg_match('|Opera\/([^\(]+) \(.*; Opera Mini; |', $this->uastring, $regs)) {
245 $this->brand = 'Opera Mini';
246 $this->version = $regs[1];
249 elseif (preg_match('/Opera\/[^\(]+ \(.*; Opera Mini\/([^;]+); /i', $this->uastring, $regs)) {
250 $this->brand = 'Opera Mini';
251 $this->version = $regs[1];
254 elseif (preg_match('|Opera[ /]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
255 $this->brand = 'Opera';
256 $this->version = $regs[1];
259 elseif (preg_match('|OmniWeb/([0-9a-zA-Z\.+-]+)|', $this->uastring, $regs)) {
260 $this->brand = 'OmniWeb';
261 $this->version = $regs[1];
264 elseif (preg_match('|Konqueror/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
265 $this->brand = 'Konqueror';
266 $this->version = $regs[1];
269 elseif (preg_match('|Shiira/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
270 $this->brand = 'Shiira';
271 $this->version = $regs[1];
274 elseif (preg_match('|Safari/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
275 $this->brand = 'Safari';
276 $this->version = $regs[1];
279 elseif (preg_match('|AppleWebKit/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
280 $this->brand = 'AppleWebKit';
281 $this->version = $regs[1];
284 elseif (preg_match('|MSFrontPage/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
285 $this->brand = 'Microsoft FrontPage';
286 $this->version = $regs[1];
289 elseif (preg_match('|iCab[/ ]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
290 $this->brand = 'iCab';
291 $this->version = $regs[1];
294 elseif (preg_match('|IBrowse[/ ]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
295 $this->brand = 'IBrowse';
296 $this->version = $regs[1];
299 elseif (preg_match('|ICEbrowser/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
300 $this->brand = 'ICEbrowser';
301 $this->version = $regs[1];
304 elseif (preg_match('|ICE Browser/v([0-9a-zA-Z\._+]+)|', $this->uastring, $regs)) {
305 $this->brand = 'ICEbrowser';
306 $this->version = str_replace('_', '.', $regs[1]);
309 elseif (preg_match('|NetPositive/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
310 $this->brand = 'NetPositive';
311 $this->version = $regs[1];
314 elseif (preg_match('|WebPro/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
315 $this->brand = 'WebPro (Novarra)';
316 $this->version = $regs[1];
319 elseif (preg_match('|; OffByOne;|', $this->uastring, $regs)) {
320 $this->brand = 'Off By One';
321 $this->version = null;
324 elseif (preg_match('|PSP \(PlayStation Portable\); ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
325 $this->brand = 'PlayStation Portable';
326 $this->version = $regs[1];
329 elseif (preg_match('|PLAYSTATION 3; ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
330 $this->brand = 'PlayStation 3';
331 $this->version = $regs[1];
334 elseif (preg_match('|NetFront/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
335 $this->brand = 'NetFront';
336 $this->version = $regs[1];
339 elseif (preg_match('|UP.Browser/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
340 $this->brand = 'UP.Browser';
341 $this->version = $regs[1];
344 elseif (preg_match('|UP.Link/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
345 $this->brand = 'UP.Link';
346 $this->version = $regs[1];
349 elseif (preg_match('|AU-MIC-([0-9A-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
350 $this->brand = 'Obigo';
351 $this->version = $regs[1];
354 elseif (preg_match('|Nokia([0-9a-zA-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
355 $this->brand = 'Nokia';
356 $this->version = $regs[1];
359 elseif (preg_match('|SonyEricsson([0-9a-zA-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
360 $this->brand = 'SonyEricsson';
361 $this->version = $regs[1];
364 elseif (preg_match('|SIE-([0-9a-zA-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
365 $this->brand = 'Siemens';
366 $this->version = $regs[1];
369 elseif (preg_match('|MOT-([0-9a-zA-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
370 $this->brand = 'Motorola';
371 $this->version = $regs[1];
374 elseif (preg_match('|IXI/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
375 $this->brand = 'IXI';
376 $this->version = $regs[1];
379 elseif (preg_match('|IBM-WebExplorer-DLL/v([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
380 $this->brand = 'WebExplorer';
381 $this->version = $regs[1];
384 elseif (preg_match('|ELinks \(([0-9a-zA-Z\.+]+);|', $this->uastring, $regs)) {
385 $this->brand = 'ELinks';
386 $this->version = $regs[1];
389 elseif (preg_match('|Links \(([0-9a-zA-Z\.+]+);|', $this->uastring, $regs)) {
390 $this->brand = 'Links';
391 $this->version = $regs[1];
394 elseif (preg_match('|WinHttp.WinHttpRequest.([0-9\.]+)|i', $this->uastring, $regs)) {
395 $this->brand = 'WinHttpRequest';
396 $this->version = $regs[1];
399 elseif (preg_match('|alpha[/ ]06; AmigaOS|i', $this->uastring, $regs)) {
400 $this->brand = 'Alpha 06';
401 $this->version = null;
404 elseif (preg_match('|; arexx[\);]|i', $this->uastring, $regs)) {
405 $this->brand = 'ARexx';
406 $this->version = null;
409 elseif (preg_match('|; Voyager; AmigaOS[\);]|i', $this->uastring, $regs)) {
410 $this->brand = 'AmigaVoyager';
411 $this->version = null;
414 elseif (preg_match('|AWEB ([0-9a-zA-Z\.+ ]+)|', $this->uastring, $regs)) {
415 $this->brand = 'AWEB';
416 $this->version = $regs[1];
419 elseif (preg_match('|X ([0-9a-zA-Z\.+ ]+); Commodore 64|', $this->uastring, $regs)) {
421 $this->version = $regs[1];
424 elseif (preg_match('|DB Browse ([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) {
425 $this->brand = 'DB Browse';
426 $this->version = $regs[1];
429 elseif (preg_match('|ZyBorg/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
430 $this->brand = 'ZyBorg';
431 $this->version = $regs[1];
434 elseif (preg_match('|Ask Jeeves/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
435 $this->brand = 'Ask Jeeves';
436 $this->version = $regs[1];
439 elseif (preg_match('|heritrix/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
440 $this->brand = 'Heritrix';
441 $this->version = $regs[1];
444 elseif (preg_match('|([0-9a-zA-Z\.+]+bot)/([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) {
445 $this->brand = $regs[1];
446 $this->version = $regs[2];
449 elseif (preg_match('|VoilaBot ((BETA )?[0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) {
450 $this->brand = 'VoilaBot';
451 $this->version = $regs[1];
454 elseif (preg_match('|Slurp|', $this->uastring, $regs)) {
455 $this->brand = 'Slurp';
456 $this->version = null;
459 elseif (preg_match('|Check&Get ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
460 $this->brand = 'Check&Get';
461 $this->version = $regs[1];
464 elseif (preg_match('|WebCapture ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
465 $this->brand = 'WebCapture';
466 $this->version = $regs[1];
469 elseif (preg_match('|WebMon ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
470 $this->brand = 'WebMon';
471 $this->version = $regs[1];
474 elseif (preg_match('|Powermarks/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
475 $this->brand = 'Powermarks';
476 $this->version = $regs[1];
479 elseif (preg_match('|Gulper Web Bot ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
480 $this->brand = 'Gulper Web Bot';
481 $this->version = $regs[1];
484 elseif (preg_match('|HTTrack ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
485 $this->brand = 'HTTrack';
486 $this->version = $regs[1];
489 elseif (preg_match('|Twiceler-([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
490 $this->brand = 'Twiceler';
491 $this->version = $regs[1];
494 elseif (preg_match('|Microsoft URL Control - ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
495 $this->brand = 'Microsoft URL Control';
496 $this->version = $regs[1];
499 elseif (preg_match('|([0-9a-zA-Z\.+]+)_AC-Plug|', $this->uastring, $regs)) {
500 $this->brand = 'AC-Plug';
501 $this->version = $regs[1];
504 elseif (preg_match('|^Internet Explorer 5.5|', $this->uastring)) {
505 $this->brand = 'Unknown bot (IE5.5)';
506 $this->version = null;
509 elseif (preg_match('|^Mozilla[\s ]*$|', $this->uastring)) {
510 $this->brand = 'Unknown bot (Mozilla)';
511 $this->version = null;
514 elseif (preg_match('|http://www.livedir.net|', $this->uastring, $regs)) {
515 $this->brand = 'livedir.net';
516 $this->version = null;
519 elseif (preg_match('|WebClipping.com|', $this->uastring, $regs)) {
520 $this->brand = 'WebClipping.com';
521 $this->version = null;
524 elseif (preg_match('|http://www.almaden.ibm.com/cs/crawler|', $this->uastring)) {
525 $this->brand = 'almaden crawler';
526 $this->version = null;
529 elseif (preg_match('|B-l-i-t-z-B-O-T|', $this->uastring) ||
530 preg_match('|B l i t z B O T @ t r i c u s . n e t|', $this->uastring)) {
531 $this->brand = 'BlitzBOT';
532 $this->version = null;
535 elseif (preg_match('|Really Gmane.org\'s favicon grabber|', $this->uastring)) {
536 $this->brand = 'Really Gmane.org\'s favicon grabber';
537 $this->version = null;
540 elseif (preg_match('|Girafabot|', $this->uastring)) {
541 $this->brand = 'Girafabot';
542 $this->version = null;
545 elseif (preg_match('|Arachmo|', $this->uastring)) {
546 $this->brand = 'Arachmo';
547 $this->version = null;
550 elseif (preg_match('|OsO|', $this->uastring)) {
551 $this->brand = 'OsO';
552 $this->version = null;
555 elseif (preg_match('|Yoono|', $this->uastring)) {
556 $this->brand = 'Yoono';
557 $this->version = null;
560 elseif (preg_match('|efp@gmx.net|', $this->uastring)) {
561 $this->brand = 'efp';
562 $this->version = null;
565 elseif (preg_match('|Baiduspider|i', $this->uastring)) {
566 $this->brand = 'BaiDuSpider';
567 $this->version = null;
570 elseif (preg_match('|Indy Library|', $this->uastring)) {
571 $this->brand = 'Indy Library';
572 $this->version = null;
575 elseif (preg_match('|Linkman|', $this->uastring)) {
576 $this->brand = 'Linkman';
577 $this->version = null;
580 elseif (preg_match('|Sage|', $this->uastring, $regs)) {
581 $this->brand = 'Sage';
582 $this->version = null;
585 elseif (preg_match('|Google Desktop|', $this->uastring)) {
586 $this->brand = 'Google Desktop';
587 $this->version = null;
590 elseif (preg_match('|^Firefly|', $this->uastring)) {
591 // comes here with correct value but would be detected as MSIE
593 elseif (preg_match('|Steganos Internet Anonym([0-9a-zA-Z\. +]*)|', $this->uastring, $regs)) {
594 $this->brand = 'Steganos Internet Anonym';
595 $this->version = $regs[1];
598 elseif (preg_match('|Steganos Internet Anonym([0-9a-zA-Z\. +]*)|', $this->uastring, $regs)) {
599 $this->brand = 'Steganos Internet Anonym';
600 $this->version = $regs[1];
603 elseif (preg_match('|BorderManager ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
604 $this->brand = 'BorderManager';
605 $this->version = $regs[1];
608 elseif (preg_match('|WebWasher ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
609 $this->brand = 'WebWasher';
610 $this->version = $regs[1];
613 elseif (preg_match('|SaferSurf|', $this->uastring, $regs)) {
614 $this->brand = 'SaferSurf';
615 $this->version = null;
618 elseif (preg_match('|Avant Browser[^/]|', $this->uastring)) {
619 $this->brand = 'Avant Browser';
620 $this->version = null;
623 elseif (preg_match('|Browser[^/]+(http://www.avantbrowser.com)|', $this->uastring)) {
624 $this->brand = 'Avant Browser';
625 $this->version = null;
628 elseif (preg_match('|Maxthon|', $this->uastring)) {
629 $this->brand = 'Maxthon';
630 $this->version = null;
633 elseif (preg_match('|MyIE2|', $this->uastring)) {
634 $this->brand = 'MyIE2';
635 $this->version = null;
638 elseif (preg_match('|Crazy Browser ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
639 $this->brand = 'Crazy Browser';
640 $this->version = $regs[1];
643 elseif (preg_match('|AvantGo ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
644 $this->brand = 'AvantGo';
645 $this->version = $regs[1];
648 elseif (preg_match('|MSN ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
649 $this->brand = 'MSN';
650 $this->version = $regs[1];
653 elseif (preg_match('|America Online Browser [0-9a-zA-Z\.+]+; rev([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
654 $this->brand = 'AOL Browser';
655 $this->version = $regs[1];
658 elseif (preg_match('|MS FrontPage ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
659 $this->brand = 'Microsoft FrontPage';
660 $this->version = $regs[1];
663 elseif (preg_match('|Microsoft Internet Explorer/4.0b1|', $this->uastring, $regs)) {
664 $this->brand = 'Microsoft Internet Explorer';
665 $this->version = '1.0';
668 elseif (preg_match('|MSIE ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
669 $this->brand = 'Microsoft Internet Explorer';
670 $this->version = $regs[1];
673 elseif (preg_match('|MSPIE ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
674 $this->brand = 'Microsoft Pocket Internet Explorer';
675 $this->version = $regs[1];
678 elseif (preg_match('|Mozilla/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs) &&
679 (strpos($this->uastring, 'compatible') === false) && (strpos($this->uastring, 'Gecko/') === false) &&
680 (intval($regs[1]) < 5)) {
681 $this->brand = 'Netscape';
682 $this->version = $regs[1];
683 if (intval($this->version) == 4) { $this->brand .= ' Communicator'; }
686 elseif (preg_match('|Mozilla/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
687 $this->brand = (strpos($this->uastring, 'compatible') !== false)?'Mozilla-compatible (unknown)':'Mozilla (unknown)';
688 $this->version = null;
692 $botArray = array('Scooter','Spinne','Vagabondo','Firefly','Scrubby','NG','Pompos','Szukacz','Schmozilla','42_HAL',
693 'NetResearchServer','LinkWalker','Zeus','W3C_Validator','ZyBorg','Ask Jeeves','ia_archiver',
694 'PingALink Monitoring Services','IlTrovatore-Setaccio','Nutch','Mercator','search.ch',
695 'appie','larbin','NutchCVS','Webchat','Mediapartners-Google','sitecheck.internetseer.com',
696 'FavOrg','findlinks','DataCha0s','ichiro','Francis','','','','','');
698 if (in_array($this->brand, $botArray)) {
703 public function getBrand() { return $this->brand; }
704 public function getVersion() { return $this->version; }
706 public function getAcceptLanguages() {
707 if (!isset($this->uadata['accept-languages'])) {
708 $headers = getAllHeaders();
709 $accLcomp = explode(',', $headers['Accept-Language']);
711 foreach ($accLcomp as $lcomp) {
712 if (strlen($lcomp)) {
713 $ldef = explode(';', $lcomp);
714 $accLang[$ldef[0]] = (float)((strpos(@$ldef[1],'q=')===0)?substr($ldef[1],2):1);
717 $this->uadata['accept-languages'] = $accLang;
719 return $this->uadata['accept-languages'];
722 public function getUAString() { return $this->uastring; }
724 public function getEngine() {
725 // return gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|icestorm|netfront|unknown
726 if (!isset($this->uadata['engine'])) {
727 $this->uadata['engine'] = 'unknown';
728 $this->uadata['geckodate'] = null;
729 if (preg_match('|Gecko/([0-9]+)|', $this->uastring, $regs)) {
730 $this->uadata['engine'] = 'gecko';
731 $this->uadata['geckodate'] = $regs[1];
733 elseif ((strpos($this->brand, 'Internet Explorer') !== false) || (strpos($this->brand, 'FrontPage') !== false)) {
734 if ((strpos(strtolower($this->uastring), 'mac') !== false) && (intval($this->getVersion()) >= 5)) {
735 $this->uadata['engine'] = 'tasman';
738 $this->uadata['engine'] = 'trident';
741 elseif ((strpos($this->brand, 'Konqueror') !== false) || (strpos($this->brand, 'Safari') !== false) ||
742 (strpos($this->brand, 'Shiira') !== false) ||
743 (strpos($this->brand, 'AppleWebKit') !== false) || (strpos($this->brand, 'OmniWeb') !== false)) {
744 $this->uadata['engine'] = 'khtml';
746 elseif (strpos($this->brand, 'Netscape') !== false) {
747 // non-Gecko Netscape browsers
748 if (intval($this->version) <= 4) {
749 $this->uadata['engine'] = 'nscp';
751 elseif (strpos($this->uastring, 'MSIE') !== false) {
752 $this->uadata['engine'] = 'trident';
755 elseif (strpos($this->brand, 'Opera') !== false) {
756 $this->uadata['engine'] = 'presto';
758 elseif (strpos($this->brand, 'Dillo') !== false) {
759 $this->uadata['engine'] = 'gzilla';
761 elseif ((strpos($this->brand, 'ELinks') !== false) || (strpos($this->brand, 'Links') !== false)) {
762 $this->uadata['engine'] = 'links';
764 elseif ((strpos($this->brand, 'ICEbrowser') !== false) || (strpos($this->brand, 'ICE Browser') !== false)) {
765 $this->uadata['engine'] = 'icestorm';
767 elseif ((strpos($this->brand, 'PlayStation') !== false) || (strpos($this->brand, 'NetFront') !== false)) {
768 $this->uadata['engine'] = 'netfront';
770 elseif ((strpos($this->brand, 'Avant') !== false) || (strpos($this->brand, 'Crazy Browser') !== false) ||
771 (strpos($this->brand, 'AOL') !== false) || (strpos($this->brand, 'MSN') !== false) ||
772 (strpos($this->brand, 'MyIE2') !== false) || (strpos($this->brand, 'Maxthon') !== false)) {
773 $this->uadata['engine'] = 'trident';
775 elseif (strpos($this->brand, 'Galeon') !== false) {
776 $this->uadata['engine'] = 'gecko';
778 elseif (strpos($this->brand, 'WebPro') !== false) {
779 $this->uadata['engine'] = 'nscp';
782 return $this->uadata['engine'];
785 public function hasEngine($rnd_engine) { return ($this->getEngine() == $rnd_engine); }
787 public function getEngineVersion() {
788 if (!isset($this->uadata['eng_version'])) {
789 $this->uadata['eng_version'] = null;
790 // getOS() should get the date for us
793 return $this->uadata['eng_version'];
796 public function getOS() {
797 if (!isset($this->uadata['os'])) {
798 $this->uadata['os'] = null;
799 if ($this->hasEngine('gecko')) {
800 if (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^;]+); rv:([^\);]+)(; [^\)]+)?\)|', $this->uastring, $regs)) {
801 $this->uadata['os'] = $regs[2];
802 $this->uadata['lang'] = (strpos($regs[3],'chrome://')===false)?$regs[3]:null;
803 $this->uadata['eng_version'] = $regs[4];
805 elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); rv:([^\);]+)(; [^\)]+)?\)|', $this->uastring, $regs)) {
806 $this->uadata['os'] = $regs[2];
807 $this->uadata['lang'] = null;
808 $this->uadata['eng_version'] = $regs[3];
810 elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^;]+); m([^\);]+)\)|', $this->uastring, $regs)) {
811 $this->uadata['os'] = $regs[2];
812 $this->uadata['lang'] = $regs[3];
813 $this->uadata['eng_version'] = 'M'.$regs[4];
815 elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); m([^\);]+)\)|', $this->uastring, $regs)) {
816 $this->uadata['os'] = $regs[1];
817 $this->uadata['lang'] = $regs[2];
818 $this->uadata['eng_version'] = 'M'.$regs[3];
820 elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^\);]+)\)|', $this->uastring, $regs)) {
821 $this->uadata['os'] = $regs[2];
822 $this->uadata['lang'] = $regs[3];
823 $this->uadata['eng_version'] = null;
825 elseif (preg_match('|Mozilla/5.0 \(([^;]+); ([^;]+); rv:([^\);]+)\)|', $this->uastring, $regs)) {
826 $this->uadata['os'] = $regs[2];
827 $this->uadata['lang'] = null;
828 $this->uadata['eng_version'] = $regs[3];
830 elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^\);]+)\)|', $this->uastring, $regs)) {
831 $this->uadata['os'] = $regs[2];
832 $this->uadata['lang'] = null;
833 $this->uadata['eng_version'] = null;
835 elseif (preg_match('|Mozilla/5.0 Galeon/[^\(]+ \(([^;]+); ([^;]+);[^\)]+\)|', $this->uastring, $regs)) {
836 $this->uadata['os'] = $regs[2];
837 $this->uadata['lang'] = null;
838 $this->uadata['eng_version'] = null;
840 elseif (preg_match('|Debian/|', $this->uastring, $regs)) {
841 $this->uadata['os'] = 'Debian Linux';
842 $this->uadata['lang'] = null;
843 $this->uadata['eng_version'] = null;
846 elseif ($this->hasEngine('trident') || $this->hasEngine('tasman')) {
847 if (preg_match('/Mozilla\/[^\(]+ \(compatible *; MSP?IE ([^;]+)[^\)]*; ?((?:Mac|Win)[^;]+)[^\)]*\)/i', $this->uastring, $regs)) {
848 $this->uadata['eng_version'] = (strpos($this->uastring,'MSPIE')!==false)?null:$regs[1];
849 $this->uadata['os'] = $regs[2];
850 $this->uadata['lang'] = null;
852 elseif (preg_match('/Mozilla\/[^\(]+ \(compatible *; MSIE ([^;]+)[^\)]*\)/i', $this->uastring, $regs)) {
853 $this->uadata['eng_version'] = $regs[1];
854 $this->uadata['os'] = null;
855 $this->uadata['lang'] = null;
857 elseif (preg_match('/Microsoft Internet Explorer\/[^\s]+ \(((?:Mac|Win)[^;\)]+)\)/i', $this->uastring, $regs)) {
858 $this->uadata['eng_version'] = $this->getVersion();
859 $this->uadata['os'] = $regs[1];
860 $this->uadata['lang'] = null;
862 elseif (preg_match('/Microsoft Pocket Internet Explorer\/[^\s]+/i', $this->uastring, $regs)) {
863 $this->uadata['eng_version'] = null;
864 $this->uadata['os'] = 'Windows CE';
865 $this->uadata['lang'] = null;
868 elseif ($this->hasEngine('khtml')) {
869 if (preg_match('/Mozilla\/[^\(]+ \(compatible; Konqueror\/([^;]+); ([^;]+); ([^;]+); ([^;]+); ([^\);]+)\)(?: KHTML\/([0-9a-zA-Z\.+]+))?/i', $this->uastring, $regs)) {
870 $this->uadata['eng_version'] = strlen($regs[6])?$regs[6]:$regs[1];
871 $this->uadata['os'] = $regs[2];
872 $this->uadata['lang'] = $regs[5];
874 elseif (preg_match('/Mozilla\/[^\(]+ \(compatible; Konqueror\/([^;]+); ([^\);]+)[^\)]*\)(?: KHTML\/([0-9a-zA-Z\.+]+))?/i', $this->uastring, $regs)) {
875 $this->uadata['eng_version'] = strlen($regs[3])?$regs[3]:$regs[1];
876 $this->uadata['os'] = $regs[2];
877 $this->uadata['lang'] = null;
879 elseif (preg_match('|Mozilla/5.0 \(([^;]+); U; ([^;]+); ([^\);]+)\)|', $this->uastring, $regs)) {
880 $this->uadata['os'] = $regs[2];
881 $this->uadata['lang'] = $regs[3];
882 $this->uadata['eng_version'] = null;
884 elseif (preg_match('|Mozilla/5.0 \(([^;]+); U; ([^\);]+)\)|', $this->uastring, $regs)) {
885 $this->uadata['os'] = $regs[1];
886 $this->uadata['lang'] = $regs[2];
887 $this->uadata['eng_version'] = null;
889 elseif (preg_match('/Mozilla\/[^\(]+ \(compatible; [^;]+; ([^\);]+)\)/i', $this->uastring, $regs)) {
890 $this->uadata['os'] = $regs[1];
891 $this->uadata['lang'] = null;
892 $this->uadata['eng_version'] = null;
895 elseif ($this->hasEngine('presto')) {
897 if (preg_match('/Opera\/[^\(]+ \((?:X11; )?([^;]+)[^\)]+\) +\[([a-z_-]+)\]/i', $this->uastring, $regs)) {
898 $this->uadata['eng_version'] = $this->getVersion();
899 $this->uadata['os'] = $regs[1];
900 $this->uadata['lang'] = $regs[2];
902 elseif (preg_match('/Mozilla\/[^\(]+ \(compatible; MSIE [^;]+; (?:X11; )?([^;\)]+)[^\)]*\) Opera [^ ]+ +\[([a-z_-]+)\]/i', $this->uastring, $regs)) {
903 $this->uadata['eng_version'] = $this->getVersion();
904 $this->uadata['os'] = $regs[1];
905 $this->uadata['lang'] = $regs[2];
907 elseif (preg_match('/Mozilla\/[^\(]+ \((?:X11; )?([^;]+);.+\) Opera [^ ]+ \[([a-z_-]+)\]/i', $this->uastring, $regs)) {
908 $this->uadata['eng_version'] = $this->getVersion();
909 $this->uadata['os'] = $regs[1];
910 $this->uadata['lang'] = $regs[2];
913 elseif (preg_match('/Opera\/([^\(]+) \((?:X11; )?([^;]+); Opera Mini; ([a-z_-]+); /i', $this->uastring, $regs)) {
914 $this->uadata['eng_version'] = null;
915 $this->uadata['os'] = $regs[2];
916 $this->uadata['lang'] = $regs[3];
918 elseif (preg_match('/Opera\/([^\(]+) \((?:X11; )?([^;]+); Opera Mini\/[^;]+; ([a-z_-]+); /i', $this->uastring, $regs)) {
919 $this->uadata['eng_version'] = $regs[1];
920 $this->uadata['os'] = $regs[2];
921 $this->uadata['lang'] = $regs[3];
924 elseif (preg_match('/Opera\/[^\(]+ \((?:X11; )?([^;]+); [^\)]+; ([a-z_-]+)\)/i', $this->uastring, $regs)) {
925 $this->uadata['eng_version'] = $this->getVersion();
926 $this->uadata['os'] = $regs[1];
927 $this->uadata['lang'] = $regs[2];
929 elseif (preg_match('/Mozilla\/[^\(]+ \(compatible; MSIE [^;]+; (?:X11; )?([^;]+); ([a-z_-]+)\) Opera [^ ]+/i', $this->uastring, $regs)) {
930 $this->uadata['eng_version'] = $this->getVersion();
931 $this->uadata['os'] = $regs[1];
932 $this->uadata['lang'] = $regs[2];
934 elseif (preg_match('/Mozilla\/[^\(]+ \((?:X11; )?([^;]+);.+; ([a-z_-]+)\) Opera [^ ]+/i', $this->uastring, $regs)) {
935 $this->uadata['eng_version'] = $this->getVersion();
936 $this->uadata['os'] = $regs[1];
937 $this->uadata['lang'] = $regs[2];
940 elseif ($this->hasEngine('nscp')) {
941 if (preg_match('/Mozilla\/([0-9a-zA-Z\.+]+) (?:\[([a-z_-]+)\][^\(]+)?\(X11; [^;]+; ([^\)]+)\)/i', $this->uastring, $regs)) {
942 $this->uadata['eng_version'] = $regs[1];
943 $this->uadata['os'] = $regs[3];
944 $this->uadata['lang'] = $regs[2];
946 elseif (preg_match('/Mozilla\/([0-9a-zA-Z\.+]+) (?:\[([a-z_-]+)\][^\(]+)?\(([^;]+);[^\)]+\)/i', $this->uastring, $regs)) {
947 $this->uadata['eng_version'] = $regs[1];
948 $this->uadata['os'] = $regs[3];
949 $this->uadata['lang'] = $regs[2];
951 elseif (preg_match('/Mozilla\/([0-9a-zA-Z\.+]+)[^\(]+\(([^;]+);[^\)]+\)/i', $this->uastring, $regs)) {
952 $this->uadata['eng_version'] = $regs[1];
953 $this->uadata['os'] = $regs[2];
954 $this->uadata['lang'] = null;
957 elseif ($this->hasEngine('gzilla')) {
958 $this->uadata['eng_version'] = $this->getVersion();
959 $this->uadata['os'] = null;
960 $this->uadata['lang'] = null;
962 elseif ($this->hasEngine('links')) {
963 if (preg_match('/E?Links[^\(]+\([^;]+; ([^;]+)[^\)]+\)/i', $this->uastring, $regs)) {
964 $this->uadata['eng_version'] = null;
965 $this->uadata['os'] = $regs[1];
966 $this->uadata['lang'] = null;
969 elseif ($this->hasEngine('icestorm')) {
970 if (preg_match('/ICE Browser\/v?([0-9a-zA-Z\._+]+) \(Java [^;]+; ([^\)]+)\)/i', $this->uastring, $regs)) {
971 $this->uadata['eng_version'] = str_replace('_', '.', $regs[1]);
972 $this->uadata['os'] = $regs[2];
973 $this->uadata['lang'] = null;
975 elseif (preg_match('/Mozilla\/[^\(]+ \((?:X11; )?([^;]+);.+; ([a-z_-]+)\).* ICEbrowser\/([0-9a-zA-Z\._+]+)/i', $this->uastring, $regs)) {
976 $this->uadata['eng_version'] = $regs[3];
977 $this->uadata['os'] = $regs[1];
978 $this->uadata['lang'] = $regs[2];
982 $this->uadata['eng_version'] = null;
983 $this->uadata['lang'] = null;
984 if (preg_match('/AmigaOS/i', $this->uastring, $regs)) {
985 $this->uadata['os'] = 'AmigaOS';
987 if (preg_match('/Commodore 64/i', $this->uastring, $regs)) {
988 $this->uadata['os'] = 'Commodore 64';
990 elseif (preg_match('/curl\/[^\(]+\(([^\);]+)/i', $this->uastring, $regs)) {
991 $this->uadata['os'] = $regs[1];
993 elseif (preg_match('/NCSA[_ ]Mosaic\/[^\(]+\((?:.*;)?([^\);]+)/i', $this->uastring, $regs)) {
994 $this->uadata['os'] = trim($regs[1]);
996 elseif (preg_match('/iCab.*(Mac[^\);]+).*?\)/i', $this->uastring, $regs)) {
997 $this->uadata['os'] = trim($regs[1]);
999 elseif (preg_match('/SymbianOS\/([^ ]+)/i', $this->uastring, $regs)) {
1000 $this->uadata['os'] = 'SymbianOS '.$regs[1];
1003 if ($this->uadata['os'] == 'Win 9x 4.90') { $this->uadata['os'] = 'Windows ME'; }
1004 elseif ($this->uadata['os'] == 'WinNT4.0') { $this->uadata['os'] = 'Windows NT 4.0'; }
1005 elseif ($this->uadata['os'] == 'Windows NT 5.0') { $this->uadata['os'] = 'Windows 2000'; }
1006 elseif ($this->uadata['os'] == 'Windows NT 5.1') { $this->uadata['os'] = 'Windows XP'; }
1007 elseif ($this->uadata['os'] == 'Windows NT 5.2') { $this->uadata['os'] = 'Windows 2003'; }
1008 elseif ($this->uadata['os'] == 'Windows NT 5.2 x64') { $this->uadata['os'] = 'Windows 2003 (64bit)'; }
1009 elseif ($this->uadata['os'] == 'Windows NT 6.0') { $this->uadata['os'] = 'Windows Vista'; }
1010 elseif ($this->uadata['os'] == 'Win95') { $this->uadata['os'] = 'Windows 95'; }
1011 elseif ($this->uadata['os'] == 'Win98') { $this->uadata['os'] = 'Windows 98'; }
1012 elseif ($this->uadata['os'] == 'WinNT') { $this->uadata['os'] = 'Windows NT'; }
1013 elseif ($this->uadata['os'] == 'Win32') { $this->uadata['os'] = 'Windows (32bit)'; }
1014 elseif ($this->uadata['os'] == 'Win64') { $this->uadata['os'] = 'Windows (64bit)'; }
1015 elseif (preg_match('/Mac ?OS ?X/i',$this->uadata['os'])) { $this->uadata['os'] = 'MacOS X'; }
1016 elseif (preg_match('/Mac_P(ower|)PC/i',$this->uadata['os'])) { $this->uadata['os'] = 'MacOS'; }
1017 elseif (strpos($this->uadata['os'], 'darwin') !== false) { $this->uadata['os'] = 'MacOS X'; }
1018 elseif (strpos($this->uadata['os'], 'Darwin') !== false) { $this->uadata['os'] = 'MacOS X'; }
1019 elseif (strpos($this->uadata['os'], 'apple') !== false) { $this->uadata['os'] = 'MacOS'; }
1020 elseif (strpos($this->uadata['os'], 'Macintosh') !== false) { $this->uadata['os'] = 'MacOS'; }
1021 elseif (strpos($this->uadata['os'], 'linux') !== false) { $this->uadata['os'] = 'Linux'; }
1023 if (strpos($this->uadata['os'], 'Win') !== false) { $this->uadata['platform'] = 'Windows'; }
1024 elseif (strpos($this->uadata['os'], 'Mac') !== false) { $this->uadata['platform'] = 'Macintosh'; }
1025 elseif (strpos($this->uadata['os'], 'Linux') !== false) { $this->uadata['platform'] = 'Linux'; }
1026 elseif (strpos($this->uadata['os'], 'Solaris') !== false) { $this->uadata['platform'] = 'Solaris'; }
1027 elseif (strpos($this->uadata['os'], 'SunOS') !== false) { $this->uadata['platform'] = 'Solaris'; }
1028 elseif (strpos($this->uadata['os'], 'BeOS') !== false) { $this->uadata['platform'] = 'BeOS'; }
1029 elseif (strpos($this->uadata['os'], 'FreeBSD') !== false) { $this->uadata['platform'] = 'FreeBSD'; }
1030 elseif (strpos($this->uadata['os'], 'OpenBSD') !== false) { $this->uadata['platform'] = 'OpenBSD'; }
1031 elseif (strpos($this->uadata['os'], 'NetBSD') !== false) { $this->uadata['platform'] = 'NetBSD'; }
1032 elseif (strpos($this->uadata['os'], 'AIX') !== false) { $this->uadata['platform'] = 'AIX'; }
1033 elseif (strpos($this->uadata['os'], 'IRIX') !== false) { $this->uadata['platform'] = 'IRIX'; }
1034 elseif (strpos($this->uadata['os'], 'HP-UX') !== false) { $this->uadata['platform'] = 'HP-UX'; }
1035 elseif (strpos($this->uadata['os'], 'AmigaOS') !== false) { $this->uadata['platform'] = 'Amiga'; }
1036 elseif (strpos($this->uadata['os'], 'Commodore 64') !== false) { $this->uadata['platform'] = 'C64'; }
1037 elseif (strpos($this->uadata['os'], 'OpenVMS') !== false) { $this->uadata['platform'] = 'OpenVMS'; }
1038 elseif (strpos($this->uadata['os'], 'Warp') !== false) { $this->uadata['platform'] = 'OS/2'; }
1039 elseif (strpos($this->uadata['os'], 'SymbianOS') !== false) { $this->uadata['platform'] = 'SymbianOS'; }
1040 elseif (strpos($this->uadata['os'], 'CYGWIN') !== false) { $this->uadata['platform'] = 'Windows'; }
1041 else { $this->uadata['platform'] = $this->uadata['os']; }
1043 $this->uadata['lang'] = str_replace('_', '-', $this->uadata['lang']);
1045 return $this->uadata['os'];
1048 public function getPlatform() {
1049 if (!isset($this->uadata['platform'])) {
1050 $this->uadata['platform'] = null;
1051 // getOS() should get the date for us
1054 return $this->uadata['platform'];
1057 public function getLanguage() {
1058 if (!isset($this->uadata['lang'])) {
1059 $this->uadata['lang'] = null;
1060 // getOS() should get the date for us
1063 return $this->uadata['lang'];
1066 public function getGeckoDate() {
1067 if (!isset($this->uadata['geckodate'])) {
1068 $this->uadata['geckodate'] = null;
1069 // getEngine() should get the date for us
1072 return $this->uadata['geckodate'];
1075 public function isBot() { return $this->bot; }
1077 public function isns() {
1078 trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE);
1079 return (strpos($this->brand, 'Netscape') !== false);
1081 public function isns4() {
1082 trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE);
1083 return ((strpos($this->brand, 'Netscape') !== false) && (intval($this->version) == 4));
1085 public function isie() {
1086 trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE);
1087 return $this->hasEngine('trident');
1089 public function geckodate() {
1090 trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE);
1091 return (!is_null($this->getGeckoDate())?$this->getGeckoDate():0);
1093 public function geckobased() {
1094 trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE);
1095 return $this->hasEngine('gecko');
1097 public function khtmlbased() {
1098 trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE);
1099 return $this->hasEngine('khtml');