Skip to content

Commit 93a5ec0

Browse files
tigrazoneGabriel Ames-Bull
authored andcommitted
Create Browser-new.php
1 parent 51ef24b commit 93a5ec0

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

Browser.php

100755100644
Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* File: Browser.php
44
* Author: Chris Schuld (http://chrisschuld.com/)
5-
* Last Modified: August 20th, 2010
6-
* @version 1.9
5+
* Last Modified: March 11th, 2013
6+
* @version 1.10
77
* @package PegasusPHP
88
*
99
* Copyright (C) 2008-2010 Chris Schuld ([email protected])
@@ -34,6 +34,9 @@
3434
*
3535
* UPDATES:
3636
*
37+
* 2013-03-08 (v1.10):
38+
* + Added SeaMonkey Browser
39+
*
3740
* 2010-08-20 (v1.9):
3841
* + Added MSN Explorer Browser (legacy)
3942
* + Added Bing/MSN Robot (Thanks Rob MacDonald)
@@ -156,6 +159,7 @@ class Browser {
156159
const BROWSER_OMNIWEB = 'OmniWeb'; // http://www.omnigroup.com/applications/omniweb/
157160
const BROWSER_FIREBIRD = 'Firebird'; // http://www.ibphoenix.com/
158161
const BROWSER_FIREFOX = 'Firefox'; // http://www.mozilla.com/en-US/firefox/firefox.html
162+
const BROWSER_SEAMONKEY = 'SeaMonkey'; // http://www.seamonkey-project.org/
159163
const BROWSER_ICEWEASEL = 'Iceweasel'; // http://www.geticeweasel.org/
160164
const BROWSER_SHIRETOKO = 'Shiretoko'; // http://wiki.mozilla.org/Projects/shiretoko
161165
const BROWSER_MOZILLA = 'Mozilla'; // http://www.mozilla.com/en-US/
@@ -369,6 +373,7 @@ protected function checkBrowsers() {
369373
$this->checkBrowserOpera() ||
370374
$this->checkBrowserGaleon() ||
371375
$this->checkBrowserNetscapeNavigator9Plus() ||
376+
$this->checkBrowserSeaMonkey() ||
372377
$this->checkBrowserFirefox() ||
373378
$this->checkBrowserChrome() ||
374379
$this->checkBrowserOmniWeb() ||
@@ -815,6 +820,26 @@ protected function checkBrowserFirefox() {
815820
}
816821
return false;
817822
}
823+
824+
/**
825+
* Determine if the browser is SeaMonkey or not (last updated 1.10)
826+
* @return boolean True if the browser is SeaMonkey otherwise false
827+
*/
828+
protected function checkBrowserSeaMonkey() {
829+
if( stripos($this->_agent,'safari') === false ) {
830+
if( preg_match("/SeaMonkey[\/ \(]([^ ;\)]+)/i",$this->_agent,$matches) ) {
831+
$this->setVersion($matches[1]);
832+
$this->setBrowser(self::BROWSER_SEAMONKEY);
833+
return true;
834+
}
835+
else if( preg_match("/SeaMonkey$/i",$this->_agent,$matches) ) {
836+
$this->setVersion("");
837+
$this->setBrowser(self::BROWSER_SEAMONKEY);
838+
return true;
839+
}
840+
}
841+
return false;
842+
}
818843

819844
/**
820845
* Determine if the browser is Firefox or not (last updated 1.7)

0 commit comments

Comments
 (0)