Commit | Line | Data |
---|---|---|
31733e08 | 1 | <?php |
a5813ca3 | 2 | /* ***** BEGIN LICENSE BLOCK ***** |
3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
4 | * | |
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/ | |
9 | * | |
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 | |
13 | * License. | |
14 | * | |
15 | * The Original Code is KaiRo's userAgent detection. | |
16 | * | |
17 | * The Initial Developer of the Original Code is | |
18 | * KaiRo - Robert Kaiser. | |
c863ed1e | 19 | * Portions created by the Initial Developer are Copyright (C) 2003-2007 |
a5813ca3 | 20 | * the Initial Developer. All Rights Reserved. |
21 | * | |
22 | * Contributor(s): Robert Kaiser <kairo@kairo.at> | |
23 | * | |
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. | |
35 | * | |
36 | * ***** END LICENSE BLOCK ***** */ | |
37 | ||
31733e08 | 38 | class userAgent { |
39 | // userAgent PHP class | |
40 | // get user agent and tell us what Browser is accessing | |
41 | // | |
3077a4f6 | 42 | // function __construct([$ua_string]) |
1defa974 | 43 | // CONSTRUCTOR; reads UA string (or takes the optional given UA string) and gets info from that into our variables. |
31733e08 | 44 | // |
3077a4f6 | 45 | // private $uastring |
31733e08 | 46 | // the plain User Agent string |
3077a4f6 | 47 | // private $brand |
bf78d3ed | 48 | // the User Agent brand name |
3077a4f6 | 49 | // private $version |
31733e08 | 50 | // the User Agent version |
3077a4f6 | 51 | // private $bot |
a8464009 | 52 | // bool: true if this agent is a bot |
3077a4f6 | 53 | // private $uadata |
f983aa36 | 54 | // array of static user agent data (static vars in functions are set for all objects of this class!) |
31733e08 | 55 | // |
3077a4f6 | 56 | // public function getBrand() |
23585ba2 | 57 | // returns the User Agent Brand Name |
bf78d3ed | 58 | // |
3077a4f6 | 59 | // public function getVersion() |
23585ba2 | 60 | // returns the User Agent version |
61 | // | |
3077a4f6 | 62 | // public function getAcceptLanguages() |
4210e7b0 | 63 | // returns an associated array with the accepted languages of this UA |
64 | // keys are language codes, values are q factors (weights) | |
65 | // | |
3077a4f6 | 66 | // public function getUAString() |
f983aa36 | 67 | // returns the full User Agent string |
68 | // | |
3077a4f6 | 69 | // public function getEngine() |
bf78d3ed | 70 | // returns a string telling the detected rendering engine, null if we can't detect |
c18a4476 | 71 | // one of gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|icestorm|unknown |
bf78d3ed | 72 | // |
3077a4f6 | 73 | // public function hasEngine($rnd_engine) |
bf78d3ed | 74 | // returns true if the given rendering engine was detected |
75 | // | |
3077a4f6 | 76 | // public function getEngineVersion() |
bf78d3ed | 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 | |
79 | // | |
3077a4f6 | 80 | // public function getOS() |
bf78d3ed | 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 | |
83 | // | |
3077a4f6 | 84 | // public function getPlatform() |
bf78d3ed | 85 | // returns a string telling the detected OS platform, null if we can't detect |
ac9220c2 | 86 | // one of windows|linux|mac|solaris|unknown |
bf78d3ed | 87 | // |
3077a4f6 | 88 | // public function getLanguage() { |
bf78d3ed | 89 | // returns a string telling the detected browser UI language, null if we can't detect |
90 | // should be an ISO code | |
91 | // | |
3077a4f6 | 92 | // public function isBot() |
a8464009 | 93 | // returns true if User Agent seems to be a bot |
bf78d3ed | 94 | // |
95 | // *** functions that only return useable info for some agents *** | |
96 | // | |
3077a4f6 | 97 | // public function getGeckoDate() |
bf78d3ed | 98 | // returns the Gecko date for Gecko-based browsers, null for others |
99 | // | |
a3e499ad RK |
100 | // public function getGeckoTime() |
101 | // returns the Gecko build date/time as a unix epoch time number for Gecko-based browsers, null for others | |
102 | // | |
bf78d3ed | 103 | // *** functions for compat to older versions of this class *** |
104 | // | |
3077a4f6 | 105 | // public function isns() |
31733e08 | 106 | // returns true if User Agent seems to be Netscape brand, false if not |
3077a4f6 | 107 | // public function isns4() |
31733e08 | 108 | // returns true if User Agent seems to be Netscape Communicator 4.x, false if not |
3077a4f6 | 109 | // public function isie() |
31733e08 | 110 | // returns true if User Agent seems to be a version of Internet Exploder, false if not |
3077a4f6 | 111 | // public function geckobased() |
31733e08 | 112 | // returns true if User Agent seems to be a Gecko-based browser, false if not |
3077a4f6 | 113 | // public function geckodate() |
31733e08 | 114 | // returns the Gecko date when it's a Gecko-based browser, 0 if not |
3077a4f6 | 115 | // public function khtmlbased() |
1defa974 | 116 | // returns true if User Agent seems to be a KHTML-based browser, false if not |
117 | ||
118 | // collection of some known User Agent Strings: | |
bf78d3ed | 119 | // *** see testbed/ua_list_raw.txt *** |
120 | // *** see also http://www.pgts.com.au/pgtsj/pgtsj0208c.html *** | |
31733e08 | 121 | |
3077a4f6 | 122 | private $uastring; |
123 | private $brand; | |
124 | private $version; | |
125 | private $bot = false; | |
126 | private $uadata = array(); | |
31733e08 | 127 | |
3077a4f6 | 128 | function __construct($ua_string = '') { |
31733e08 | 129 | // *** constructor *** |
1defa974 | 130 | if (strlen($ua_string)) { |
131 | $this->uastring = $ua_string; | |
132 | } | |
133 | else { | |
134 | // read raw UA string | |
4210e7b0 | 135 | $this->uastring = $_SERVER['HTTP_USER_AGENT']; |
1defa974 | 136 | } |
31733e08 | 137 | |
138 | // get UA brand and version | |
bf78d3ed | 139 | $this->brand = 'Unknown'; $this->version = null; |
140 | // find reasonable defaults | |
06c9b824 | 141 | if (preg_match('|([0-9a-zA-Z\.:()_ -]+)/(\d[0-9a-zA-Z\._+-]*)|', $this->uastring, $regs)) { |
bf78d3ed | 142 | $this->brand = trim($regs[1]); |
143 | $this->version = $regs[2]; | |
144 | } | |
06c9b824 | 145 | elseif (preg_match('|^([a-zA-Z\._ -]+)[_ -][vV]?(\d[0-9a-zA-Z\.+]*)|', $this->uastring, $regs)) { |
bf78d3ed | 146 | $this->brand = trim($regs[1]); |
147 | $this->version = $regs[2]; | |
148 | } | |
06c9b824 | 149 | elseif (preg_match('|^([0-9a-zA-Z\._ -]+)|', $this->uastring, $regs)) { |
bf78d3ed | 150 | $this->brand = trim($regs[1]); |
151 | $this->version = null; | |
152 | } | |
81e72a3e | 153 | $this->bot = (strpos(strtolower($this->brand), 'bot') !== false) |
154 | || (strpos(strtolower($this->brand), 'crawler') !== false) | |
06c9b824 RK |
155 | || (strpos(strtolower($this->brand), 'spider') !== false) |
156 | || (strpos(strtolower($this->brand), 'search') !== false) | |
157 | || (strpos(strtolower($this->brand), 'seek') !== false); | |
81e72a3e | 158 | |
bf78d3ed | 159 | // search for any real and/or special UAs |
160 | if (preg_match('|Netscape6/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
161 | $this->brand = 'Netscape'; | |
31733e08 | 162 | $this->version = $regs[1]; |
81e72a3e | 163 | $this->bot = false; |
31733e08 | 164 | } |
bf78d3ed | 165 | elseif (preg_match('|Netscape/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
166 | $this->brand = 'Netscape'; | |
31733e08 | 167 | $this->version = $regs[1]; |
81e72a3e | 168 | $this->bot = false; |
31733e08 | 169 | } |
208cf837 RK |
170 | elseif (preg_match('|Navigator/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
171 | $this->brand = 'Netscape'; | |
172 | $this->version = $regs[1]; | |
173 | $this->bot = false; | |
174 | } | |
bf78d3ed | 175 | elseif (preg_match('|Chimera/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
176 | $this->brand = 'Chimera'; | |
1defa974 | 177 | $this->version = $regs[1]; |
81e72a3e | 178 | $this->bot = false; |
1defa974 | 179 | } |
bf78d3ed | 180 | elseif (preg_match('|Camino/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
181 | $this->brand = 'Camino'; | |
a5813ca3 | 182 | $this->version = $regs[1]; |
81e72a3e | 183 | $this->bot = false; |
a5813ca3 | 184 | } |
bf78d3ed | 185 | elseif (preg_match('|Phoenix/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
186 | $this->brand = 'Phoenix'; | |
1defa974 | 187 | $this->version = $regs[1]; |
81e72a3e | 188 | $this->bot = false; |
1defa974 | 189 | } |
bf78d3ed | 190 | elseif (preg_match('|Mozilla Firebird/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
191 | $this->brand = 'Mozilla Firebird'; | |
23585ba2 | 192 | $this->version = $regs[1]; |
81e72a3e | 193 | $this->bot = false; |
23585ba2 | 194 | } |
c18a4476 | 195 | elseif (preg_match('|Flock/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
196 | $this->brand = 'Flock'; | |
197 | $this->version = $regs[1]; | |
198 | $this->bot = false; | |
199 | } | |
b24eb888 | 200 | elseif (preg_match('|SeaMonkey/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
201 | $this->brand = 'SeaMonkey'; | |
202 | $this->version = $regs[1]; | |
81e72a3e | 203 | $this->bot = false; |
b24eb888 | 204 | } |
c18a4476 | 205 | elseif (preg_match('|Iceape/([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) { |
206 | $this->brand = 'IceApe'; | |
207 | $this->version = $regs[1]; | |
208 | $this->bot = false; | |
209 | } | |
210 | elseif (preg_match('|Iceweasel/([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) { | |
211 | $this->brand = 'IceWeasel'; | |
212 | $this->version = $regs[1]; | |
213 | $this->bot = false; | |
214 | } | |
208cf837 RK |
215 | elseif (preg_match('|Minefield/([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) { |
216 | $this->brand = 'Minefield'; | |
217 | $this->version = $regs[1]; | |
218 | $this->bot = false; | |
219 | } | |
220 | elseif (preg_match('|Minimo/([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) { | |
221 | $this->brand = 'Minimo'; | |
222 | $this->version = $regs[1]; | |
223 | $this->bot = false; | |
224 | } | |
bf78d3ed | 225 | elseif (preg_match('|Galeon/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
226 | $this->brand = 'Galeon'; | |
31733e08 | 227 | $this->version = $regs[1]; |
81e72a3e | 228 | $this->bot = false; |
31733e08 | 229 | } |
6e783db6 | 230 | elseif (preg_match('|Epiphany/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
231 | $this->brand = 'Epiphany'; | |
232 | $this->version = $regs[1]; | |
81e72a3e | 233 | $this->bot = false; |
6e783db6 | 234 | } |
235 | elseif (preg_match('|K-Meleon/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
236 | $this->brand = 'K-Meleon'; | |
237 | $this->version = $regs[1]; | |
81e72a3e | 238 | $this->bot = false; |
6e783db6 | 239 | } |
240 | elseif (preg_match('|AOL[/ ]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
241 | $this->brand = 'AOL'; | |
242 | $this->version = $regs[1]; | |
81e72a3e | 243 | $this->bot = false; |
6e783db6 | 244 | } |
c18a4476 | 245 | elseif (preg_match('|Opera\/([^\(]+) \(.*; Opera Mini; |', $this->uastring, $regs)) { |
246 | $this->brand = 'Opera Mini'; | |
247 | $this->version = $regs[1]; | |
248 | $this->bot = false; | |
249 | } | |
250 | elseif (preg_match('/Opera\/[^\(]+ \(.*; Opera Mini\/([^;]+); /i', $this->uastring, $regs)) { | |
251 | $this->brand = 'Opera Mini'; | |
252 | $this->version = $regs[1]; | |
253 | $this->bot = false; | |
254 | } | |
bf78d3ed | 255 | elseif (preg_match('|Opera[ /]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
256 | $this->brand = 'Opera'; | |
31733e08 | 257 | $this->version = $regs[1]; |
81e72a3e | 258 | $this->bot = false; |
31733e08 | 259 | } |
c18a4476 | 260 | elseif (preg_match('|OmniWeb/([0-9a-zA-Z\.+-]+)|', $this->uastring, $regs)) { |
bf78d3ed | 261 | $this->brand = 'OmniWeb'; |
1defa974 | 262 | $this->version = $regs[1]; |
81e72a3e | 263 | $this->bot = false; |
1defa974 | 264 | } |
bf78d3ed | 265 | elseif (preg_match('|Konqueror/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
266 | $this->brand = 'Konqueror'; | |
31733e08 | 267 | $this->version = $regs[1]; |
81e72a3e | 268 | $this->bot = false; |
31733e08 | 269 | } |
c18a4476 | 270 | elseif (preg_match('|Shiira/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
271 | $this->brand = 'Shiira'; | |
272 | $this->version = $regs[1]; | |
273 | $this->bot = false; | |
274 | } | |
bf78d3ed | 275 | elseif (preg_match('|Safari/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
276 | $this->brand = 'Safari'; | |
588763e6 RK |
277 | if (preg_match('|Version/([0-9a-zA-Z\.+]+)|', $this->uastring, $vregs)) { |
278 | $this->version = $vregs[1]; | |
279 | } | |
280 | else { | |
281 | $this->version = '('.$regs[1].')'; | |
282 | } | |
81e72a3e | 283 | $this->bot = false; |
1defa974 | 284 | } |
bf78d3ed | 285 | elseif (preg_match('|AppleWebKit/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
286 | $this->brand = 'AppleWebKit'; | |
1defa974 | 287 | $this->version = $regs[1]; |
81e72a3e | 288 | $this->bot = false; |
1defa974 | 289 | } |
208cf837 RK |
290 | elseif (preg_match('|Firefox/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
291 | $this->brand = 'Firefox'; | |
292 | $this->version = $regs[1]; | |
293 | $this->bot = false; | |
294 | } | |
295 | elseif (preg_match('|rv:([0-9a-zA-Z\.+]+)|', $this->uastring, $regs) && | |
296 | strstr($this->uastring, "Mozilla/") && strstr($this->uastring, "Gecko/")) { | |
297 | $this->brand = 'Mozilla'; | |
298 | $this->version = $regs[1]; | |
299 | $this->bot = false; | |
300 | } | |
301 | elseif (preg_match('|m([0-9]+)\)|', $this->uastring, $regs) && | |
302 | strstr($this->uastring, "Mozilla/") && strstr($this->uastring, "Gecko/")) { | |
303 | $this->brand = 'Mozilla'; | |
304 | $this->version = 'M'.$regs[1]; | |
305 | $this->bot = false; | |
306 | } | |
bf78d3ed | 307 | elseif (preg_match('|MSFrontPage/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
308 | $this->brand = 'Microsoft FrontPage'; | |
f983aa36 | 309 | $this->version = $regs[1]; |
81e72a3e | 310 | $this->bot = false; |
f983aa36 | 311 | } |
bf78d3ed | 312 | elseif (preg_match('|iCab[/ ]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
313 | $this->brand = 'iCab'; | |
a8464009 | 314 | $this->version = $regs[1]; |
81e72a3e | 315 | $this->bot = false; |
a8464009 | 316 | } |
bf78d3ed | 317 | elseif (preg_match('|IBrowse[/ ]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
318 | $this->brand = 'IBrowse'; | |
a8464009 | 319 | $this->version = $regs[1]; |
81e72a3e | 320 | $this->bot = false; |
a8464009 | 321 | } |
c18a4476 | 322 | elseif (preg_match('|ICEbrowser/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
323 | $this->brand = 'ICEbrowser'; | |
324 | $this->version = $regs[1]; | |
325 | $this->bot = false; | |
326 | } | |
327 | elseif (preg_match('|ICE Browser/v([0-9a-zA-Z\._+]+)|', $this->uastring, $regs)) { | |
328 | $this->brand = 'ICEbrowser'; | |
329 | $this->version = str_replace('_', '.', $regs[1]); | |
330 | $this->bot = false; | |
331 | } | |
332 | elseif (preg_match('|NetPositive/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
333 | $this->brand = 'NetPositive'; | |
334 | $this->version = $regs[1]; | |
335 | $this->bot = false; | |
336 | } | |
337 | elseif (preg_match('|WebPro/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
338 | $this->brand = 'WebPro (Novarra)'; | |
339 | $this->version = $regs[1]; | |
340 | $this->bot = false; | |
341 | } | |
342 | elseif (preg_match('|; OffByOne;|', $this->uastring, $regs)) { | |
343 | $this->brand = 'Off By One'; | |
344 | $this->version = null; | |
345 | $this->bot = false; | |
346 | } | |
347 | elseif (preg_match('|PSP \(PlayStation Portable\); ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
348 | $this->brand = 'PlayStation Portable'; | |
349 | $this->version = $regs[1]; | |
350 | $this->bot = false; | |
351 | } | |
b50f91ef | 352 | elseif (preg_match('|PLAYSTATION 3; ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
353 | $this->brand = 'PlayStation 3'; | |
354 | $this->version = $regs[1]; | |
355 | $this->bot = false; | |
356 | } | |
c18a4476 | 357 | elseif (preg_match('|NetFront/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
358 | $this->brand = 'NetFront'; | |
a8464009 | 359 | $this->version = $regs[1]; |
81e72a3e | 360 | $this->bot = false; |
a8464009 | 361 | } |
6e783db6 | 362 | elseif (preg_match('|UP.Browser/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
363 | $this->brand = 'UP.Browser'; | |
364 | $this->version = $regs[1]; | |
81e72a3e | 365 | $this->bot = false; |
6e783db6 | 366 | } |
c18a4476 | 367 | elseif (preg_match('|UP.Link/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
368 | $this->brand = 'UP.Link'; | |
369 | $this->version = $regs[1]; | |
370 | $this->bot = false; | |
371 | } | |
372 | elseif (preg_match('|AU-MIC-([0-9A-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
373 | $this->brand = 'Obigo'; | |
374 | $this->version = $regs[1]; | |
375 | $this->bot = false; | |
376 | } | |
377 | elseif (preg_match('|Nokia([0-9a-zA-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
378 | $this->brand = 'Nokia'; | |
379 | $this->version = $regs[1]; | |
380 | $this->bot = false; | |
381 | } | |
382 | elseif (preg_match('|SonyEricsson([0-9a-zA-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
383 | $this->brand = 'SonyEricsson'; | |
384 | $this->version = $regs[1]; | |
385 | $this->bot = false; | |
386 | } | |
387 | elseif (preg_match('|SIE-([0-9a-zA-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
388 | $this->brand = 'Siemens'; | |
389 | $this->version = $regs[1]; | |
390 | $this->bot = false; | |
391 | } | |
392 | elseif (preg_match('|MOT-([0-9a-zA-Z]+/[0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
393 | $this->brand = 'Motorola'; | |
394 | $this->version = $regs[1]; | |
395 | $this->bot = false; | |
396 | } | |
b50f91ef | 397 | elseif (preg_match('|IXI/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
398 | $this->brand = 'IXI'; | |
399 | $this->version = $regs[1]; | |
400 | $this->bot = false; | |
401 | } | |
c18a4476 | 402 | elseif (preg_match('|IBM-WebExplorer-DLL/v([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
403 | $this->brand = 'WebExplorer'; | |
404 | $this->version = $regs[1]; | |
405 | $this->bot = false; | |
406 | } | |
bf78d3ed | 407 | elseif (preg_match('|ELinks \(([0-9a-zA-Z\.+]+);|', $this->uastring, $regs)) { |
408 | $this->brand = 'ELinks'; | |
a8464009 | 409 | $this->version = $regs[1]; |
81e72a3e | 410 | $this->bot = false; |
a8464009 | 411 | } |
6e783db6 | 412 | elseif (preg_match('|Links \(([0-9a-zA-Z\.+]+);|', $this->uastring, $regs)) { |
413 | $this->brand = 'Links'; | |
414 | $this->version = $regs[1]; | |
81e72a3e | 415 | $this->bot = false; |
6e783db6 | 416 | } |
b50f91ef | 417 | elseif (preg_match('|WinHttp.WinHttpRequest.([0-9\.]+)|i', $this->uastring, $regs)) { |
418 | $this->brand = 'WinHttpRequest'; | |
419 | $this->version = $regs[1]; | |
420 | $this->bot = false; | |
421 | } | |
422 | elseif (preg_match('|alpha[/ ]06; AmigaOS|i', $this->uastring, $regs)) { | |
423 | $this->brand = 'Alpha 06'; | |
424 | $this->version = null; | |
425 | $this->bot = false; | |
426 | } | |
427 | elseif (preg_match('|; arexx[\);]|i', $this->uastring, $regs)) { | |
c18a4476 | 428 | $this->brand = 'ARexx'; |
429 | $this->version = null; | |
430 | $this->bot = false; | |
431 | } | |
b50f91ef | 432 | elseif (preg_match('|; Voyager; AmigaOS[\);]|i', $this->uastring, $regs)) { |
433 | $this->brand = 'AmigaVoyager'; | |
434 | $this->version = null; | |
435 | $this->bot = false; | |
436 | } | |
437 | elseif (preg_match('|AWEB ([0-9a-zA-Z\.+ ]+)|', $this->uastring, $regs)) { | |
438 | $this->brand = 'AWEB'; | |
439 | $this->version = $regs[1]; | |
440 | $this->bot = false; | |
441 | } | |
442 | elseif (preg_match('|X ([0-9a-zA-Z\.+ ]+); Commodore 64|', $this->uastring, $regs)) { | |
443 | $this->brand = 'X'; | |
444 | $this->version = $regs[1]; | |
445 | $this->bot = false; | |
446 | } | |
447 | elseif (preg_match('|DB Browse ([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) { | |
448 | $this->brand = 'DB Browse'; | |
449 | $this->version = $regs[1]; | |
450 | $this->bot = false; | |
451 | } | |
bf78d3ed | 452 | elseif (preg_match('|ZyBorg/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
453 | $this->brand = 'ZyBorg'; | |
a8464009 | 454 | $this->version = $regs[1]; |
455 | $this->bot = true; | |
456 | } | |
bf78d3ed | 457 | elseif (preg_match('|Ask Jeeves/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
458 | $this->brand = 'Ask Jeeves'; | |
a8464009 | 459 | $this->version = $regs[1]; |
460 | $this->bot = true; | |
461 | } | |
4e8c44da | 462 | elseif (preg_match('|heritrix/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
463 | $this->brand = 'Heritrix'; | |
464 | $this->version = $regs[1]; | |
465 | $this->bot = true; | |
466 | } | |
b50f91ef | 467 | elseif (preg_match('|([0-9a-zA-Z\.+]+bot)/([0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) { |
468 | $this->brand = $regs[1]; | |
469 | $this->version = $regs[2]; | |
470 | $this->bot = true; | |
471 | } | |
472 | elseif (preg_match('|VoilaBot ((BETA )?[0-9a-zA-Z\.+]+)|i', $this->uastring, $regs)) { | |
473 | $this->brand = 'VoilaBot'; | |
474 | $this->version = $regs[1]; | |
475 | $this->bot = true; | |
476 | } | |
c51ab9a2 | 477 | elseif (preg_match('|Slurp|', $this->uastring, $regs)) { |
bf78d3ed | 478 | $this->brand = 'Slurp'; |
c51ab9a2 | 479 | $this->version = null; |
a8464009 | 480 | $this->bot = true; |
481 | } | |
b50f91ef | 482 | elseif (preg_match('|Check&Get ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
483 | $this->brand = 'Check&Get'; | |
484 | $this->version = $regs[1]; | |
485 | $this->bot = true; | |
486 | } | |
487 | elseif (preg_match('|WebCapture ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
488 | $this->brand = 'WebCapture'; | |
489 | $this->version = $regs[1]; | |
490 | $this->bot = true; | |
491 | } | |
492 | elseif (preg_match('|WebMon ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
493 | $this->brand = 'WebMon'; | |
494 | $this->version = $regs[1]; | |
495 | $this->bot = true; | |
496 | } | |
497 | elseif (preg_match('|Powermarks/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
498 | $this->brand = 'Powermarks'; | |
499 | $this->version = $regs[1]; | |
500 | $this->bot = true; | |
501 | } | |
bf78d3ed | 502 | elseif (preg_match('|Gulper Web Bot ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
503 | $this->brand = 'Gulper Web Bot'; | |
a8464009 | 504 | $this->version = $regs[1]; |
505 | $this->bot = true; | |
506 | } | |
bf78d3ed | 507 | elseif (preg_match('|HTTrack ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
508 | $this->brand = 'HTTrack'; | |
a8464009 | 509 | $this->version = $regs[1]; |
510 | $this->bot = true; | |
511 | } | |
b50f91ef | 512 | elseif (preg_match('|Twiceler-([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
513 | $this->brand = 'Twiceler'; | |
514 | $this->version = $regs[1]; | |
515 | $this->bot = true; | |
516 | } | |
5b8eba2a | 517 | elseif (preg_match('|Microsoft URL Control - ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
518 | $this->brand = 'Microsoft URL Control'; | |
519 | $this->version = $regs[1]; | |
520 | $this->bot = true; | |
521 | } | |
81e72a3e | 522 | elseif (preg_match('|([0-9a-zA-Z\.+]+)_AC-Plug|', $this->uastring, $regs)) { |
523 | $this->brand = 'AC-Plug'; | |
524 | $this->version = $regs[1]; | |
525 | $this->bot = true; | |
526 | } | |
bf78d3ed | 527 | elseif (preg_match('|^Internet Explorer 5.5|', $this->uastring)) { |
528 | $this->brand = 'Unknown bot (IE5.5)'; | |
529 | $this->version = null; | |
a8464009 | 530 | $this->bot = true; |
531 | } | |
bf78d3ed | 532 | elseif (preg_match('|^Mozilla[\s ]*$|', $this->uastring)) { |
533 | $this->brand = 'Unknown bot (Mozilla)'; | |
534 | $this->version = null; | |
a8464009 | 535 | $this->bot = true; |
536 | } | |
b50f91ef | 537 | elseif (preg_match('|http://www.livedir.net|', $this->uastring, $regs)) { |
538 | $this->brand = 'livedir.net'; | |
539 | $this->version = null; | |
540 | $this->bot = true; | |
541 | } | |
542 | elseif (preg_match('|WebClipping.com|', $this->uastring, $regs)) { | |
543 | $this->brand = 'WebClipping.com'; | |
544 | $this->version = null; | |
545 | $this->bot = true; | |
546 | } | |
bf78d3ed | 547 | elseif (preg_match('|http://www.almaden.ibm.com/cs/crawler|', $this->uastring)) { |
548 | $this->brand = 'almaden crawler'; | |
549 | $this->version = null; | |
a8464009 | 550 | $this->bot = true; |
551 | } | |
b50f91ef | 552 | elseif (preg_match('|B-l-i-t-z-B-O-T|', $this->uastring) || |
553 | preg_match('|B l i t z B O T @ t r i c u s . n e t|', $this->uastring)) { | |
bf78d3ed | 554 | $this->brand = 'BlitzBOT'; |
555 | $this->version = null; | |
a8464009 | 556 | $this->bot = true; |
557 | } | |
b50f91ef | 558 | elseif (preg_match('|Really Gmane.org\'s favicon grabber|', $this->uastring)) { |
559 | $this->brand = 'Really Gmane.org\'s favicon grabber'; | |
560 | $this->version = null; | |
561 | $this->bot = true; | |
562 | } | |
bf78d3ed | 563 | elseif (preg_match('|Girafabot|', $this->uastring)) { |
564 | $this->brand = 'Girafabot'; | |
565 | $this->version = null; | |
a8464009 | 566 | $this->bot = true; |
567 | } | |
b50f91ef | 568 | elseif (preg_match('|Arachmo|', $this->uastring)) { |
569 | $this->brand = 'Arachmo'; | |
570 | $this->version = null; | |
571 | $this->bot = true; | |
572 | } | |
573 | elseif (preg_match('|OsO|', $this->uastring)) { | |
574 | $this->brand = 'OsO'; | |
575 | $this->version = null; | |
576 | $this->bot = true; | |
577 | } | |
578 | elseif (preg_match('|Yoono|', $this->uastring)) { | |
579 | $this->brand = 'Yoono'; | |
580 | $this->version = null; | |
581 | $this->bot = true; | |
582 | } | |
bf78d3ed | 583 | elseif (preg_match('|efp@gmx.net|', $this->uastring)) { |
584 | $this->brand = 'efp'; | |
585 | $this->version = null; | |
a8464009 | 586 | $this->bot = true; |
587 | } | |
81e72a3e | 588 | elseif (preg_match('|Baiduspider|i', $this->uastring)) { |
589 | $this->brand = 'BaiDuSpider'; | |
590 | $this->version = null; | |
591 | $this->bot = true; | |
592 | } | |
593 | elseif (preg_match('|Indy Library|', $this->uastring)) { | |
594 | $this->brand = 'Indy Library'; | |
595 | $this->version = null; | |
596 | $this->bot = true; | |
597 | } | |
b50f91ef | 598 | elseif (preg_match('|Linkman|', $this->uastring)) { |
599 | $this->brand = 'Linkman'; | |
600 | $this->version = null; | |
601 | $this->bot = true; | |
602 | } | |
603 | elseif (preg_match('|Sage|', $this->uastring, $regs)) { | |
604 | $this->brand = 'Sage'; | |
605 | $this->version = null; | |
606 | $this->bot = true; | |
607 | } | |
608 | elseif (preg_match('|Google Desktop|', $this->uastring)) { | |
609 | $this->brand = 'Google Desktop'; | |
610 | $this->version = null; | |
611 | $this->bot = true; | |
612 | } | |
bf78d3ed | 613 | elseif (preg_match('|^Firefly|', $this->uastring)) { |
614 | // comes here with correct value but would be detected as MSIE | |
a8464009 | 615 | } |
81e72a3e | 616 | elseif (preg_match('|Steganos Internet Anonym([0-9a-zA-Z\. +]*)|', $this->uastring, $regs)) { |
617 | $this->brand = 'Steganos Internet Anonym'; | |
618 | $this->version = $regs[1]; | |
619 | $this->bot = false; | |
620 | } | |
b50f91ef | 621 | elseif (preg_match('|Steganos Internet Anonym([0-9a-zA-Z\. +]*)|', $this->uastring, $regs)) { |
622 | $this->brand = 'Steganos Internet Anonym'; | |
623 | $this->version = $regs[1]; | |
624 | $this->bot = false; | |
625 | } | |
626 | elseif (preg_match('|BorderManager ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
627 | $this->brand = 'BorderManager'; | |
628 | $this->version = $regs[1]; | |
629 | $this->bot = false; | |
630 | } | |
631 | elseif (preg_match('|WebWasher ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
632 | $this->brand = 'WebWasher'; | |
633 | $this->version = $regs[1]; | |
634 | $this->bot = false; | |
635 | } | |
636 | elseif (preg_match('|SaferSurf|', $this->uastring, $regs)) { | |
637 | $this->brand = 'SaferSurf'; | |
638 | $this->version = null; | |
639 | $this->bot = false; | |
640 | } | |
bf78d3ed | 641 | elseif (preg_match('|Avant Browser[^/]|', $this->uastring)) { |
642 | $this->brand = 'Avant Browser'; | |
643 | $this->version = null; | |
81e72a3e | 644 | $this->bot = false; |
a8464009 | 645 | } |
c18a4476 | 646 | elseif (preg_match('|Browser[^/]+(http://www.avantbrowser.com)|', $this->uastring)) { |
647 | $this->brand = 'Avant Browser'; | |
648 | $this->version = null; | |
649 | $this->bot = false; | |
650 | } | |
6e783db6 | 651 | elseif (preg_match('|Maxthon|', $this->uastring)) { |
652 | $this->brand = 'Maxthon'; | |
653 | $this->version = null; | |
81e72a3e | 654 | $this->bot = false; |
6e783db6 | 655 | } |
656 | elseif (preg_match('|MyIE2|', $this->uastring)) { | |
657 | $this->brand = 'MyIE2'; | |
658 | $this->version = null; | |
81e72a3e | 659 | $this->bot = false; |
6e783db6 | 660 | } |
bf78d3ed | 661 | elseif (preg_match('|Crazy Browser ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
662 | $this->brand = 'Crazy Browser'; | |
663 | $this->version = $regs[1]; | |
81e72a3e | 664 | $this->bot = false; |
665 | } | |
666 | elseif (preg_match('|AvantGo ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { | |
667 | $this->brand = 'AvantGo'; | |
668 | $this->version = $regs[1]; | |
669 | $this->bot = false; | |
a8464009 | 670 | } |
bf78d3ed | 671 | elseif (preg_match('|MSN ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
672 | $this->brand = 'MSN'; | |
673 | $this->version = $regs[1]; | |
81e72a3e | 674 | $this->bot = false; |
a8464009 | 675 | } |
c18a4476 | 676 | elseif (preg_match('|America Online Browser [0-9a-zA-Z\.+]+; rev([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
677 | $this->brand = 'AOL Browser'; | |
678 | $this->version = $regs[1]; | |
679 | $this->bot = false; | |
680 | } | |
bf78d3ed | 681 | elseif (preg_match('|MS FrontPage ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
682 | $this->brand = 'Microsoft FrontPage'; | |
683 | $this->version = $regs[1]; | |
81e72a3e | 684 | $this->bot = false; |
a8464009 | 685 | } |
c18a4476 | 686 | elseif (preg_match('|Microsoft Internet Explorer/4.0b1|', $this->uastring, $regs)) { |
687 | $this->brand = 'Microsoft Internet Explorer'; | |
688 | $this->version = '1.0'; | |
689 | $this->bot = false; | |
690 | } | |
bf78d3ed | 691 | elseif (preg_match('|MSIE ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
692 | $this->brand = 'Microsoft Internet Explorer'; | |
31733e08 | 693 | $this->version = $regs[1]; |
81e72a3e | 694 | $this->bot = false; |
31733e08 | 695 | } |
c18a4476 | 696 | elseif (preg_match('|MSPIE ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
697 | $this->brand = 'Microsoft Pocket Internet Explorer'; | |
698 | $this->version = $regs[1]; | |
699 | $this->bot = false; | |
700 | } | |
b50f91ef | 701 | elseif (preg_match('|Mozilla/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs) && |
702 | (strpos($this->uastring, 'compatible') === false) && (strpos($this->uastring, 'Gecko/') === false) && | |
703 | (intval($regs[1]) < 5)) { | |
bf78d3ed | 704 | $this->brand = 'Netscape'; |
1defa974 | 705 | $this->version = $regs[1]; |
bf78d3ed | 706 | if (intval($this->version) == 4) { $this->brand .= ' Communicator'; } |
81e72a3e | 707 | $this->bot = false; |
708 | } | |
b50f91ef | 709 | elseif (preg_match('|Mozilla/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { |
710 | $this->brand = (strpos($this->uastring, 'compatible') !== false)?'Mozilla-compatible (unknown)':'Mozilla (unknown)'; | |
81e72a3e | 711 | $this->version = null; |
712 | $this->bot = false; | |
1defa974 | 713 | } |
a8464009 | 714 | |
06c9b824 | 715 | $botArray = array('Scooter','Spinne','Vagabondo','Firefly','Scrubby','NG','Pompos','Szukacz','Schmozilla','42_HAL', |
81e72a3e | 716 | 'NetResearchServer','LinkWalker','Zeus','W3C_Validator','ZyBorg','Ask Jeeves','ia_archiver', |
717 | 'PingALink Monitoring Services','IlTrovatore-Setaccio','Nutch','Mercator','search.ch', | |
06c9b824 RK |
718 | 'appie','larbin','NutchCVS','Webchat','Mediapartners-Google','sitecheck.internetseer.com', |
719 | 'FavOrg','findlinks','DataCha0s','ichiro','Francis','','','','',''); | |
a8464009 | 720 | |
721 | if (in_array($this->brand, $botArray)) { | |
722 | $this->bot = true; | |
723 | } | |
31733e08 | 724 | } |
725 | ||
3077a4f6 | 726 | public function getBrand() { return $this->brand; } |
727 | public function getVersion() { return $this->version; } | |
4210e7b0 | 728 | |
3077a4f6 | 729 | public function getAcceptLanguages() { |
4210e7b0 | 730 | if (!isset($this->uadata['accept-languages'])) { |
731 | $headers = getAllHeaders(); | |
732 | $accLcomp = explode(',', $headers['Accept-Language']); | |
733 | $accLang = array(); | |
734 | foreach ($accLcomp as $lcomp) { | |
735 | if (strlen($lcomp)) { | |
736 | $ldef = explode(';', $lcomp); | |
437e1c91 | 737 | $accLang[$ldef[0]] = (float)((strpos(@$ldef[1],'q=')===0)?substr($ldef[1],2):1); |
4210e7b0 | 738 | } |
739 | } | |
740 | $this->uadata['accept-languages'] = $accLang; | |
741 | } | |
742 | return $this->uadata['accept-languages']; | |
743 | } | |
744 | ||
3077a4f6 | 745 | public function getUAString() { return $this->uastring; } |
23585ba2 | 746 | |
3077a4f6 | 747 | public function getEngine() { |
b50f91ef | 748 | // return gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|icestorm|netfront|unknown |
bf78d3ed | 749 | if (!isset($this->uadata['engine'])) { |
ac9220c2 | 750 | $this->uadata['engine'] = 'unknown'; |
bf78d3ed | 751 | $this->uadata['geckodate'] = null; |
c863ed1e | 752 | if (preg_match('|Gecko/([0-9]+)|', $this->uastring, $regs) && (strpos($this->brand, 'Opera') === false)) { |
bf78d3ed | 753 | $this->uadata['engine'] = 'gecko'; |
754 | $this->uadata['geckodate'] = $regs[1]; | |
755 | } | |
756 | elseif ((strpos($this->brand, 'Internet Explorer') !== false) || (strpos($this->brand, 'FrontPage') !== false)) { | |
6e783db6 | 757 | if ((strpos(strtolower($this->uastring), 'mac') !== false) && (intval($this->getVersion()) >= 5)) { |
bf78d3ed | 758 | $this->uadata['engine'] = 'tasman'; |
759 | } | |
760 | else { | |
761 | $this->uadata['engine'] = 'trident'; | |
762 | } | |
763 | } | |
c18a4476 | 764 | elseif ((strpos($this->brand, 'Konqueror') !== false) || (strpos($this->brand, 'Safari') !== false) || |
765 | (strpos($this->brand, 'Shiira') !== false) || | |
766 | (strpos($this->brand, 'AppleWebKit') !== false) || (strpos($this->brand, 'OmniWeb') !== false)) { | |
bf78d3ed | 767 | $this->uadata['engine'] = 'khtml'; |
768 | } | |
81e72a3e | 769 | elseif (strpos($this->brand, 'Netscape') !== false) { |
770 | // non-Gecko Netscape browsers | |
771 | if (intval($this->version) <= 4) { | |
772 | $this->uadata['engine'] = 'nscp'; | |
773 | } | |
774 | elseif (strpos($this->uastring, 'MSIE') !== false) { | |
775 | $this->uadata['engine'] = 'trident'; | |
776 | } | |
bf78d3ed | 777 | } |
778 | elseif (strpos($this->brand, 'Opera') !== false) { | |
779 | $this->uadata['engine'] = 'presto'; | |
780 | } | |
781 | elseif (strpos($this->brand, 'Dillo') !== false) { | |
782 | $this->uadata['engine'] = 'gzilla'; | |
783 | } | |
784 | elseif ((strpos($this->brand, 'ELinks') !== false) || (strpos($this->brand, 'Links') !== false)) { | |
785 | $this->uadata['engine'] = 'links'; | |
786 | } | |
c18a4476 | 787 | elseif ((strpos($this->brand, 'ICEbrowser') !== false) || (strpos($this->brand, 'ICE Browser') !== false)) { |
788 | $this->uadata['engine'] = 'icestorm'; | |
789 | } | |
b50f91ef | 790 | elseif ((strpos($this->brand, 'PlayStation') !== false) || (strpos($this->brand, 'NetFront') !== false)) { |
791 | $this->uadata['engine'] = 'netfront'; | |
792 | } | |
6e783db6 | 793 | elseif ((strpos($this->brand, 'Avant') !== false) || (strpos($this->brand, 'Crazy Browser') !== false) || |
794 | (strpos($this->brand, 'AOL') !== false) || (strpos($this->brand, 'MSN') !== false) || | |
795 | (strpos($this->brand, 'MyIE2') !== false) || (strpos($this->brand, 'Maxthon') !== false)) { | |
bf78d3ed | 796 | $this->uadata['engine'] = 'trident'; |
797 | } | |
798 | elseif (strpos($this->brand, 'Galeon') !== false) { | |
799 | $this->uadata['engine'] = 'gecko'; | |
31733e08 | 800 | } |
c18a4476 | 801 | elseif (strpos($this->brand, 'WebPro') !== false) { |
802 | $this->uadata['engine'] = 'nscp'; | |
803 | } | |
31733e08 | 804 | } |
bf78d3ed | 805 | return $this->uadata['engine']; |
31733e08 | 806 | } |
807 | ||
3077a4f6 | 808 | public function hasEngine($rnd_engine) { return ($this->getEngine() == $rnd_engine); } |
bf78d3ed | 809 | |
3077a4f6 | 810 | public function getEngineVersion() { |
bf78d3ed | 811 | if (!isset($this->uadata['eng_version'])) { |
812 | $this->uadata['eng_version'] = null; | |
813 | // getOS() should get the date for us | |
814 | $this->getOS(); | |
31733e08 | 815 | } |
bf78d3ed | 816 | return $this->uadata['eng_version']; |
31733e08 | 817 | } |
818 | ||
3077a4f6 | 819 | public function getOS() { |
bf78d3ed | 820 | if (!isset($this->uadata['os'])) { |
821 | $this->uadata['os'] = null; | |
822 | if ($this->hasEngine('gecko')) { | |
81e72a3e | 823 | if (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^;]+); rv:([^\);]+)(; [^\)]+)?\)|', $this->uastring, $regs)) { |
bf78d3ed | 824 | $this->uadata['os'] = $regs[2]; |
f9a0c27d | 825 | $this->uadata['lang'] = (strpos($regs[3],'chrome://')===false)?$regs[3]:null; |
bf78d3ed | 826 | $this->uadata['eng_version'] = $regs[4]; |
827 | } | |
81e72a3e | 828 | elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); rv:([^\);]+)(; [^\)]+)?\)|', $this->uastring, $regs)) { |
829 | $this->uadata['os'] = $regs[2]; | |
830 | $this->uadata['lang'] = null; | |
831 | $this->uadata['eng_version'] = $regs[3]; | |
832 | } | |
6e783db6 | 833 | elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^;]+); m([^\);]+)\)|', $this->uastring, $regs)) { |
bf78d3ed | 834 | $this->uadata['os'] = $regs[2]; |
835 | $this->uadata['lang'] = $regs[3]; | |
836 | $this->uadata['eng_version'] = 'M'.$regs[4]; | |
837 | } | |
09cd2756 | 838 | elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); m([^\);]+)\)|', $this->uastring, $regs)) { |
839 | $this->uadata['os'] = $regs[1]; | |
840 | $this->uadata['lang'] = $regs[2]; | |
841 | $this->uadata['eng_version'] = 'M'.$regs[3]; | |
842 | } | |
6e783db6 | 843 | elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^\);]+)\)|', $this->uastring, $regs)) { |
844 | $this->uadata['os'] = $regs[2]; | |
845 | $this->uadata['lang'] = $regs[3]; | |
846 | $this->uadata['eng_version'] = null; | |
847 | } | |
f9a0c27d | 848 | elseif (preg_match('|Mozilla/5.0 \(([^;]+); ([^;]+); rv:([^\);]+)\)|', $this->uastring, $regs)) { |
849 | $this->uadata['os'] = $regs[2]; | |
850 | $this->uadata['lang'] = null; | |
851 | $this->uadata['eng_version'] = $regs[3]; | |
852 | } | |
6e783db6 | 853 | elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^\);]+)\)|', $this->uastring, $regs)) { |
bf78d3ed | 854 | $this->uadata['os'] = $regs[2]; |
855 | $this->uadata['lang'] = null; | |
856 | $this->uadata['eng_version'] = null; | |
857 | } | |
858 | elseif (preg_match('|Mozilla/5.0 Galeon/[^\(]+ \(([^;]+); ([^;]+);[^\)]+\)|', $this->uastring, $regs)) { | |
859 | $this->uadata['os'] = $regs[2]; | |
860 | $this->uadata['lang'] = null; | |
861 | $this->uadata['eng_version'] = null; | |
862 | } | |
863 | elseif (preg_match('|Debian/|', $this->uastring, $regs)) { | |
864 | $this->uadata['os'] = 'Debian Linux'; | |
865 | $this->uadata['lang'] = null; | |
866 | $this->uadata['eng_version'] = null; | |
867 | } | |
868 | } | |
6e783db6 | 869 | elseif ($this->hasEngine('trident') || $this->hasEngine('tasman')) { |
c18a4476 | 870 | if (preg_match('/Mozilla\/[^\(]+ \(compatible *; MSP?IE ([^;]+)[^\)]*; ?((?:Mac|Win)[^;]+)[^\)]*\)/i', $this->uastring, $regs)) { |
871 | $this->uadata['eng_version'] = (strpos($this->uastring,'MSPIE')!==false)?null:$regs[1]; | |
bf78d3ed | 872 | $this->uadata['os'] = $regs[2]; |
873 | $this->uadata['lang'] = null; | |
874 | } | |
81e72a3e | 875 | elseif (preg_match('/Mozilla\/[^\(]+ \(compatible *; MSIE ([^;]+)[^\)]*\)/i', $this->uastring, $regs)) { |
bf78d3ed | 876 | $this->uadata['eng_version'] = $regs[1]; |
877 | $this->uadata['os'] = null; | |
878 | $this->uadata['lang'] = null; | |
879 | } | |
c18a4476 | 880 | elseif (preg_match('/Microsoft Internet Explorer\/[^\s]+ \(((?:Mac|Win)[^;\)]+)\)/i', $this->uastring, $regs)) { |
881 | $this->uadata['eng_version'] = $this->getVersion(); | |
882 | $this->uadata['os'] = $regs[1]; | |
883 | $this->uadata['lang'] = null; | |
884 | } | |
885 | elseif (preg_match('/Microsoft Pocket Internet Explorer\/[^\s]+/i', $this->uastring, $regs)) { | |
886 | $this->uadata['eng_version'] = null; | |
887 | $this->uadata['os'] = 'Windows CE'; | |
888 | $this->uadata['lang'] = null; | |
889 | } | |
31733e08 | 890 | } |
bf78d3ed | 891 | elseif ($this->hasEngine('khtml')) { |
6e783db6 | 892 | if (preg_match('/Mozilla\/[^\(]+ \(compatible; Konqueror\/([^;]+); ([^;]+); ([^;]+); ([^;]+); ([^\);]+)\)(?: KHTML\/([0-9a-zA-Z\.+]+))?/i', $this->uastring, $regs)) { |
893 | $this->uadata['eng_version'] = strlen($regs[6])?$regs[6]:$regs[1]; | |
bf78d3ed | 894 | $this->uadata['os'] = $regs[2]; |
895 | $this->uadata['lang'] = $regs[5]; | |
896 | } | |
6e783db6 | 897 | elseif (preg_match('/Mozilla\/[^\(]+ \(compatible; Konqueror\/([^;]+); ([^\);]+)[^\)]*\)(?: KHTML\/([0-9a-zA-Z\.+]+))?/i', $this->uastring, $regs)) { |
898 | $this->uadata['eng_version'] = strlen($regs[3])?$regs[3]:$regs[1]; | |
bf78d3ed | 899 | $this->uadata['os'] = $regs[2]; |
900 | $this->uadata['lang'] = null; | |
901 | } | |
902 | elseif (preg_match('|Mozilla/5.0 \(([^;]+); U; ([^;]+); ([^\);]+)\)|', $this->uastring, $regs)) { | |
903 | $this->uadata['os'] = $regs[2]; | |
904 | $this->uadata['lang'] = $regs[3]; | |
905 | $this->uadata['eng_version'] = null; | |
906 | } | |
c18a4476 | 907 | elseif (preg_match('|Mozilla/5.0 \(([^;]+); U; ([^\);]+)\)|', $this->uastring, $regs)) { |
908 | $this->uadata['os'] = $regs[1]; | |
909 | $this->uadata['lang'] = $regs[2]; | |
910 | $this->uadata['eng_version'] = null; | |
911 | } | |
bf78d3ed | 912 | elseif (preg_match('/Mozilla\/[^\(]+ \(compatible; [^;]+; ([^\);]+)\)/i', $this->uastring, $regs)) { |
913 | $this->uadata['os'] = $regs[1]; | |
914 | $this->uadata['lang'] = null; | |
915 | $this->uadata['eng_version'] = null; | |
916 | } | |
917 | } | |
918 | elseif ($this->hasEngine('presto')) { | |
c18a4476 | 919 | // Opera < 8 |
f9a0c27d | 920 | if (preg_match('/Opera\/[^\(]+ \((?:X11; )?([^;]+)[^\)]+\) +\[([a-z_-]+)\]/i', $this->uastring, $regs)) { |
bf78d3ed | 921 | $this->uadata['eng_version'] = $this->getVersion(); |
922 | $this->uadata['os'] = $regs[1]; | |
923 | $this->uadata['lang'] = $regs[2]; | |
924 | } | |
f9a0c27d | 925 | elseif (preg_match('/Mozilla\/[^\(]+ \(compatible; MSIE [^;]+; (?:X11; )?([^;\)]+)[^\)]*\) Opera [^ ]+ +\[([a-z_-]+)\]/i', $this->uastring, $regs)) { |
6e783db6 | 926 | $this->uadata['eng_version'] = $this->getVersion(); |
927 | $this->uadata['os'] = $regs[1]; | |
928 | $this->uadata['lang'] = $regs[2]; | |
929 | } | |
f9a0c27d | 930 | elseif (preg_match('/Mozilla\/[^\(]+ \((?:X11; )?([^;]+);.+\) Opera [^ ]+ \[([a-z_-]+)\]/i', $this->uastring, $regs)) { |
6e783db6 | 931 | $this->uadata['eng_version'] = $this->getVersion(); |
932 | $this->uadata['os'] = $regs[1]; | |
933 | $this->uadata['lang'] = $regs[2]; | |
934 | } | |
c18a4476 | 935 | // Opera mini |
936 | elseif (preg_match('/Opera\/([^\(]+) \((?:X11; )?([^;]+); Opera Mini; ([a-z_-]+); /i', $this->uastring, $regs)) { | |
937 | $this->uadata['eng_version'] = null; | |
938 | $this->uadata['os'] = $regs[2]; | |
939 | $this->uadata['lang'] = $regs[3]; | |
940 | } | |
941 | elseif (preg_match('/Opera\/([^\(]+) \((?:X11; )?([^;]+); Opera Mini\/[^;]+; ([a-z_-]+); /i', $this->uastring, $regs)) { | |
942 | $this->uadata['eng_version'] = $regs[1]; | |
943 | $this->uadata['os'] = $regs[2]; | |
944 | $this->uadata['lang'] = $regs[3]; | |
945 | } | |
946 | // Opera >= 8 | |
f9a0c27d | 947 | elseif (preg_match('/Opera\/[^\(]+ \((?:X11; )?([^;]+); [^\)]+; ([a-z_-]+)\)/i', $this->uastring, $regs)) { |
bf78d3ed | 948 | $this->uadata['eng_version'] = $this->getVersion(); |
949 | $this->uadata['os'] = $regs[1]; | |
950 | $this->uadata['lang'] = $regs[2]; | |
951 | } | |
f9a0c27d | 952 | elseif (preg_match('/Mozilla\/[^\(]+ \(compatible; MSIE [^;]+; (?:X11; )?([^;]+); ([a-z_-]+)\) Opera [^ ]+/i', $this->uastring, $regs)) { |
6e783db6 | 953 | $this->uadata['eng_version'] = $this->getVersion(); |
954 | $this->uadata['os'] = $regs[1]; | |
955 | $this->uadata['lang'] = $regs[2]; | |
956 | } | |
f9a0c27d | 957 | elseif (preg_match('/Mozilla\/[^\(]+ \((?:X11; )?([^;]+);.+; ([a-z_-]+)\) Opera [^ ]+/i', $this->uastring, $regs)) { |
bf78d3ed | 958 | $this->uadata['eng_version'] = $this->getVersion(); |
959 | $this->uadata['os'] = $regs[1]; | |
960 | $this->uadata['lang'] = $regs[2]; | |
961 | } | |
c863ed1e RK |
962 | // Opera 9 Firefox-spoofing |
963 | elseif (preg_match('/Mozilla\/[^\(]+ \((?:X11; )?([^;]+);.+; ([a-z_-]+); rv:([^\);]+)\) Gecko\/\d+ Firefox\/[0-9a-zA-Z\.+]+ Opera [^ ]+/i', $this->uastring, $regs)) { | |
964 | $this->uadata['eng_version'] = $this->getVersion(); | |
965 | $this->uadata['os'] = $regs[1]; | |
966 | $this->uadata['lang'] = $regs[2]; | |
967 | } | |
bf78d3ed | 968 | } |
969 | elseif ($this->hasEngine('nscp')) { | |
f9a0c27d | 970 | if (preg_match('/Mozilla\/([0-9a-zA-Z\.+]+) (?:\[([a-z_-]+)\][^\(]+)?\(X11; [^;]+; ([^\)]+)\)/i', $this->uastring, $regs)) { |
971 | $this->uadata['eng_version'] = $regs[1]; | |
972 | $this->uadata['os'] = $regs[3]; | |
973 | $this->uadata['lang'] = $regs[2]; | |
974 | } | |
975 | elseif (preg_match('/Mozilla\/([0-9a-zA-Z\.+]+) (?:\[([a-z_-]+)\][^\(]+)?\(([^;]+);[^\)]+\)/i', $this->uastring, $regs)) { | |
bf78d3ed | 976 | $this->uadata['eng_version'] = $regs[1]; |
977 | $this->uadata['os'] = $regs[3]; | |
978 | $this->uadata['lang'] = $regs[2]; | |
979 | } | |
c18a4476 | 980 | elseif (preg_match('/Mozilla\/([0-9a-zA-Z\.+]+)[^\(]+\(([^;]+);[^\)]+\)/i', $this->uastring, $regs)) { |
981 | $this->uadata['eng_version'] = $regs[1]; | |
982 | $this->uadata['os'] = $regs[2]; | |
983 | $this->uadata['lang'] = null; | |
984 | } | |
bf78d3ed | 985 | } |
986 | elseif ($this->hasEngine('gzilla')) { | |
987 | $this->uadata['eng_version'] = $this->getVersion(); | |
988 | $this->uadata['os'] = null; | |
989 | $this->uadata['lang'] = null; | |
990 | } | |
991 | elseif ($this->hasEngine('links')) { | |
6e783db6 | 992 | if (preg_match('/E?Links[^\(]+\([^;]+; ([^;]+)[^\)]+\)/i', $this->uastring, $regs)) { |
bf78d3ed | 993 | $this->uadata['eng_version'] = null; |
994 | $this->uadata['os'] = $regs[1]; | |
995 | $this->uadata['lang'] = null; | |
996 | } | |
997 | } | |
c18a4476 | 998 | elseif ($this->hasEngine('icestorm')) { |
999 | if (preg_match('/ICE Browser\/v?([0-9a-zA-Z\._+]+) \(Java [^;]+; ([^\)]+)\)/i', $this->uastring, $regs)) { | |
1000 | $this->uadata['eng_version'] = str_replace('_', '.', $regs[1]); | |
1001 | $this->uadata['os'] = $regs[2]; | |
1002 | $this->uadata['lang'] = null; | |
1003 | } | |
1004 | elseif (preg_match('/Mozilla\/[^\(]+ \((?:X11; )?([^;]+);.+; ([a-z_-]+)\).* ICEbrowser\/([0-9a-zA-Z\._+]+)/i', $this->uastring, $regs)) { | |
1005 | $this->uadata['eng_version'] = $regs[3]; | |
1006 | $this->uadata['os'] = $regs[1]; | |
1007 | $this->uadata['lang'] = $regs[2]; | |
1008 | } | |
1009 | } | |
bf78d3ed | 1010 | else { |
1011 | $this->uadata['eng_version'] = null; | |
1012 | $this->uadata['lang'] = null; | |
1013 | if (preg_match('/AmigaOS/i', $this->uastring, $regs)) { | |
1014 | $this->uadata['os'] = 'AmigaOS'; | |
1015 | } | |
b50f91ef | 1016 | if (preg_match('/Commodore 64/i', $this->uastring, $regs)) { |
1017 | $this->uadata['os'] = 'Commodore 64'; | |
1018 | } | |
bf78d3ed | 1019 | elseif (preg_match('/curl\/[^\(]+\(([^\);]+)/i', $this->uastring, $regs)) { |
1020 | $this->uadata['os'] = $regs[1]; | |
1021 | } | |
6e783db6 | 1022 | elseif (preg_match('/NCSA[_ ]Mosaic\/[^\(]+\((?:.*;)?([^\);]+)/i', $this->uastring, $regs)) { |
1023 | $this->uadata['os'] = trim($regs[1]); | |
1024 | } | |
1025 | elseif (preg_match('/iCab.*(Mac[^\);]+).*?\)/i', $this->uastring, $regs)) { | |
1026 | $this->uadata['os'] = trim($regs[1]); | |
1027 | } | |
c51ab9a2 | 1028 | elseif (preg_match('/SymbianOS\/([^ ]+)/i', $this->uastring, $regs)) { |
1029 | $this->uadata['os'] = 'SymbianOS '.$regs[1]; | |
1030 | } | |
bf78d3ed | 1031 | } |
1032 | if ($this->uadata['os'] == 'Win 9x 4.90') { $this->uadata['os'] = 'Windows ME'; } | |
804fe4f1 | 1033 | elseif ($this->uadata['os'] == 'WinNT4.0') { $this->uadata['os'] = 'Windows NT 4.0'; } |
bf78d3ed | 1034 | elseif ($this->uadata['os'] == 'Windows NT 5.0') { $this->uadata['os'] = 'Windows 2000'; } |
1035 | elseif ($this->uadata['os'] == 'Windows NT 5.1') { $this->uadata['os'] = 'Windows XP'; } | |
1036 | elseif ($this->uadata['os'] == 'Windows NT 5.2') { $this->uadata['os'] = 'Windows 2003'; } | |
55020829 | 1037 | elseif ($this->uadata['os'] == 'Windows NT 5.2 x64') { $this->uadata['os'] = 'Windows 2003 (64bit)'; } |
1038 | elseif ($this->uadata['os'] == 'Windows NT 6.0') { $this->uadata['os'] = 'Windows Vista'; } | |
bf78d3ed | 1039 | elseif ($this->uadata['os'] == 'Win95') { $this->uadata['os'] = 'Windows 95'; } |
1040 | elseif ($this->uadata['os'] == 'Win98') { $this->uadata['os'] = 'Windows 98'; } | |
55020829 | 1041 | elseif ($this->uadata['os'] == 'WinNT') { $this->uadata['os'] = 'Windows NT'; } |
1042 | elseif ($this->uadata['os'] == 'Win32') { $this->uadata['os'] = 'Windows (32bit)'; } | |
1043 | elseif ($this->uadata['os'] == 'Win64') { $this->uadata['os'] = 'Windows (64bit)'; } | |
bf78d3ed | 1044 | elseif (preg_match('/Mac ?OS ?X/i',$this->uadata['os'])) { $this->uadata['os'] = 'MacOS X'; } |
1045 | elseif (preg_match('/Mac_P(ower|)PC/i',$this->uadata['os'])) { $this->uadata['os'] = 'MacOS'; } | |
1046 | elseif (strpos($this->uadata['os'], 'darwin') !== false) { $this->uadata['os'] = 'MacOS X'; } | |
6e783db6 | 1047 | elseif (strpos($this->uadata['os'], 'Darwin') !== false) { $this->uadata['os'] = 'MacOS X'; } |
bf78d3ed | 1048 | elseif (strpos($this->uadata['os'], 'apple') !== false) { $this->uadata['os'] = 'MacOS'; } |
6e783db6 | 1049 | elseif (strpos($this->uadata['os'], 'Macintosh') !== false) { $this->uadata['os'] = 'MacOS'; } |
bf78d3ed | 1050 | elseif (strpos($this->uadata['os'], 'linux') !== false) { $this->uadata['os'] = 'Linux'; } |
588763e6 | 1051 | elseif (preg_match('/Symbian ?OS/i',$this->uadata['os'])) { $this->uadata['os'] = 'SymbianOS'; } |
bf78d3ed | 1052 | |
6e783db6 | 1053 | if (strpos($this->uadata['os'], 'Win') !== false) { $this->uadata['platform'] = 'Windows'; } |
1054 | elseif (strpos($this->uadata['os'], 'Mac') !== false) { $this->uadata['platform'] = 'Macintosh'; } | |
1055 | elseif (strpos($this->uadata['os'], 'Linux') !== false) { $this->uadata['platform'] = 'Linux'; } | |
1056 | elseif (strpos($this->uadata['os'], 'Solaris') !== false) { $this->uadata['platform'] = 'Solaris'; } | |
1057 | elseif (strpos($this->uadata['os'], 'SunOS') !== false) { $this->uadata['platform'] = 'Solaris'; } | |
1058 | elseif (strpos($this->uadata['os'], 'BeOS') !== false) { $this->uadata['platform'] = 'BeOS'; } | |
1059 | elseif (strpos($this->uadata['os'], 'FreeBSD') !== false) { $this->uadata['platform'] = 'FreeBSD'; } | |
1060 | elseif (strpos($this->uadata['os'], 'OpenBSD') !== false) { $this->uadata['platform'] = 'OpenBSD'; } | |
1061 | elseif (strpos($this->uadata['os'], 'NetBSD') !== false) { $this->uadata['platform'] = 'NetBSD'; } | |
1062 | elseif (strpos($this->uadata['os'], 'AIX') !== false) { $this->uadata['platform'] = 'AIX'; } | |
1063 | elseif (strpos($this->uadata['os'], 'IRIX') !== false) { $this->uadata['platform'] = 'IRIX'; } | |
1064 | elseif (strpos($this->uadata['os'], 'HP-UX') !== false) { $this->uadata['platform'] = 'HP-UX'; } | |
1065 | elseif (strpos($this->uadata['os'], 'AmigaOS') !== false) { $this->uadata['platform'] = 'Amiga'; } | |
b50f91ef | 1066 | elseif (strpos($this->uadata['os'], 'Commodore 64') !== false) { $this->uadata['platform'] = 'C64'; } |
6e783db6 | 1067 | elseif (strpos($this->uadata['os'], 'OpenVMS') !== false) { $this->uadata['platform'] = 'OpenVMS'; } |
1068 | elseif (strpos($this->uadata['os'], 'Warp') !== false) { $this->uadata['platform'] = 'OS/2'; } | |
c51ab9a2 | 1069 | elseif (strpos($this->uadata['os'], 'SymbianOS') !== false) { $this->uadata['platform'] = 'SymbianOS'; } |
6e783db6 | 1070 | elseif (strpos($this->uadata['os'], 'CYGWIN') !== false) { $this->uadata['platform'] = 'Windows'; } |
1071 | else { $this->uadata['platform'] = $this->uadata['os']; } | |
bf78d3ed | 1072 | |
1073 | $this->uadata['lang'] = str_replace('_', '-', $this->uadata['lang']); | |
31733e08 | 1074 | } |
bf78d3ed | 1075 | return $this->uadata['os']; |
31733e08 | 1076 | } |
1077 | ||
3077a4f6 | 1078 | public function getPlatform() { |
bf78d3ed | 1079 | if (!isset($this->uadata['platform'])) { |
1080 | $this->uadata['platform'] = null; | |
1081 | // getOS() should get the date for us | |
1082 | $this->getOS(); | |
31733e08 | 1083 | } |
bf78d3ed | 1084 | return $this->uadata['platform']; |
31733e08 | 1085 | } |
1086 | ||
3077a4f6 | 1087 | public function getLanguage() { |
bf78d3ed | 1088 | if (!isset($this->uadata['lang'])) { |
1089 | $this->uadata['lang'] = null; | |
1090 | // getOS() should get the date for us | |
1091 | $this->getOS(); | |
31733e08 | 1092 | } |
bf78d3ed | 1093 | return $this->uadata['lang']; |
31733e08 | 1094 | } |
1defa974 | 1095 | |
3077a4f6 | 1096 | public function getGeckoDate() { |
bf78d3ed | 1097 | if (!isset($this->uadata['geckodate'])) { |
1098 | $this->uadata['geckodate'] = null; | |
1099 | // getEngine() should get the date for us | |
1100 | $this->getEngine(); | |
1defa974 | 1101 | } |
bf78d3ed | 1102 | return $this->uadata['geckodate']; |
1defa974 | 1103 | } |
bf78d3ed | 1104 | |
a3e499ad RK |
1105 | public function getGeckoTime() { |
1106 | if (!isset($this->uadata['geckotime'])) { | |
1107 | $this->uadata['geckotime'] = null; | |
1108 | if (!is_null($this->getGeckoDate())) { | |
1109 | $use_time = (strlen($this->getGeckoDate()) > 8); | |
1110 | $gd_str = substr($this->getGeckoDate(),0,4).'-'.substr($this->getGeckoDate(),4,2).'-'.substr($this->getGeckoDate(),6,2); | |
1111 | if ($use_time) { | |
1112 | $gd_str .= substr($this->getGeckoDate(),8,2).':00'; | |
1113 | $old_tz = date_default_timezone_get(); | |
1114 | date_default_timezone_set("America/Los_Angeles"); | |
1115 | } | |
1116 | $this->uadata['geckotime'] = strtotime($gd_str); | |
1117 | if ($use_time) { date_default_timezone_set($old_tz); } | |
1118 | } | |
1119 | } | |
1120 | return $this->uadata['geckotime']; | |
1121 | } | |
1122 | ||
3077a4f6 | 1123 | public function isBot() { return $this->bot; } |
1124 | ||
1125 | public function isns() { | |
1126 | trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE); | |
1127 | return (strpos($this->brand, 'Netscape') !== false); | |
1128 | } | |
1129 | public function isns4() { | |
1130 | trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE); | |
1131 | return ((strpos($this->brand, 'Netscape') !== false) && (intval($this->version) == 4)); | |
1132 | } | |
1133 | public function isie() { | |
1134 | trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE); | |
1135 | return $this->hasEngine('trident'); | |
1136 | } | |
1137 | public function geckodate() { | |
1138 | trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE); | |
1139 | return (!is_null($this->getGeckoDate())?$this->getGeckoDate():0); | |
1140 | } | |
1141 | public function geckobased() { | |
1142 | trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE); | |
1143 | return $this->hasEngine('gecko'); | |
1144 | } | |
1145 | public function khtmlbased() { | |
1146 | trigger_error(__CLASS__.'::'.__FUNCTION__.' is a deprecated function', E_USER_NOTICE); | |
1147 | return $this->hasEngine('khtml'); | |
1148 | } | |
31733e08 | 1149 | } |
23585ba2 | 1150 | ?> |