Skip to content

Commit 8a3c9c8

Browse files
authored
Merge pull request #87 from cbschuld/licensing
updated licensing to MIT
2 parents 3d0f74b + de9d1d6 commit 8a3c9c8

File tree

2 files changed

+38
-37
lines changed

2 files changed

+38
-37
lines changed

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Copyright (c) 2013 Chris Schuld
1+
Copyright 2013 - 2019 Chris Schuld <[email protected]>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

55
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
66

7-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

lib/Browser.php

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
<?php
2-
32
/**
43
* File: Browser.php
54
* Author: Chris Schuld (http://chrisschuld.com/)
6-
* Last Modified: July 9th, 2019
5+
* Last Modified: December 17, 2019
76
* @version 1.9.4
8-
* @package PegasusPHP
9-
*
10-
* Copyright (C) 2008-2019 Chris Schuld ([email protected])
11-
*
12-
* This program is free software; you can redistribute it and/or
13-
* modify it under the terms of the GNU General Public License as
14-
* published by the Free Software Foundation; either version 2 of
15-
* the License, or (at your option) any later version.
16-
*
17-
* This program is distributed in the hope that it will be useful,
18-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20-
* GNU General Public License for more details at:
21-
* http://www.gnu.org/copyleft/gpl.html
227
*
8+
* Copyright 2019 Chris Schuld
9+
*
10+
* Permission is hereby granted, free of charge, to any person obtaining a
11+
* copy of this software and associated documentation files (the "Software"),
12+
* to deal in the Software without restriction, including without
13+
* limitation the rights to use, copy, modify, merge, publish, distribute,
14+
* sublicense, and/or sell copies of the Software, and to permit persons to
15+
* whom the Software is furnished to do so, subject to the following
16+
* conditions:
17+
*
18+
* The above copyright notice and this permission notice shall be included
19+
* in all copies or substantial portions of the Software.
20+
*
21+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25+
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2328
*
2429
* Typical Usage:
2530
*
@@ -492,8 +497,7 @@ protected function checkBrowsers()
492497
$this->checkBrowserPlayStation() ||
493498
$this->checkBrowserIframely() ||
494499
$this->checkBrowserCocoa() ||
495-
$this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
496-
);
500+
$this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */);
497501
}
498502

499503
/**
@@ -886,8 +890,7 @@ protected function checkBrowserBrave()
886890
$this->setBrowser(self::BROWSER_BRAVE);
887891
return true;
888892
}
889-
}
890-
elseif (stripos($this->_agent, ' Brave ') !== false) {
893+
} elseif (stripos($this->_agent, ' Brave ') !== false) {
891894
$this->setBrowser(self::BROWSER_BRAVE);
892895
// this version of the UA did not ship with a version marker
893896
// e.g. Mozilla/5.0 (Linux; Android 7.0; SM-G955F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Brave Chrome/68.0.3440.91 Mobile Safari/537.36
@@ -953,7 +956,7 @@ protected function checkBrowserInternetExplorer()
953956
if (isset($aresult[1])) {
954957
$this->setBrowser(self::BROWSER_IE);
955958
$this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
956-
if(stripos($this->_agent, 'IEMobile') !== false) {
959+
if (stripos($this->_agent, 'IEMobile') !== false) {
957960
$this->setBrowser(self::BROWSER_POCKET_IE);
958961
$this->setMobile(true);
959962
}
@@ -1311,8 +1314,8 @@ protected function checkBrowserPalemoon()
13111314
*/
13121315
protected function checkBrowserUCBrowser()
13131316
{
1314-
if (preg_match('/UC ?Browser\/?([\d\.]+)/', $this->_agent, $matches )) {
1315-
if(isset($matches[1])) {
1317+
if (preg_match('/UC ?Browser\/?([\d\.]+)/', $this->_agent, $matches)) {
1318+
if (isset($matches[1])) {
13161319
$this->setVersion($matches[1]);
13171320
}
13181321
if (stripos($this->_agent, 'Mobile') !== false) {
@@ -1354,7 +1357,7 @@ protected function checkBrowserFirefox()
13541357
$this->setBrowser(self::BROWSER_FIREFOX);
13551358
return true;
13561359
}
1357-
} elseif ( preg_match("/FxiOS[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches) ) {
1360+
} elseif (preg_match("/FxiOS[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches)) {
13581361
$this->setVersion($matches[1]);
13591362
$this->setBrowser(self::BROWSER_FIREFOX);
13601363
//Firefox on Android
@@ -1453,7 +1456,8 @@ protected function checkBrowserAmaya()
14531456
*/
14541457
protected function checkBrowserSafari()
14551458
{
1456-
if (stripos($this->_agent, 'Safari') !== false
1459+
if (
1460+
stripos($this->_agent, 'Safari') !== false
14571461
&& stripos($this->_agent, 'iPhone') === false
14581462
&& stripos($this->_agent, 'iPod') === false
14591463
) {
@@ -1608,7 +1612,6 @@ protected function checkBrowseriPhone()
16081612
$this->checkForFacebookIos();
16091613
$this->setMobile(true);
16101614
return true;
1611-
16121615
}
16131616
return false;
16141617
}
@@ -1745,10 +1748,9 @@ protected function checkBrowserPlayStation()
17451748
* Determine if the browser is Wget or not (last updated 1.7)
17461749
* @return boolean True if the browser is Wget otherwise false
17471750
*/
1748-
protected function checkBrowserWget ()
1751+
protected function checkBrowserWget()
17491752
{
1750-
if (preg_match("!^Wget/([^ ]+)!i", $this->_agent, $aresult))
1751-
{
1753+
if (preg_match("!^Wget/([^ ]+)!i", $this->_agent, $aresult)) {
17521754
$this->setVersion($aresult[1]);
17531755
$this->setBrowser(self::BROWSER_WGET);
17541756
return true;
@@ -1759,10 +1761,9 @@ protected function checkBrowserWget ()
17591761
* Determine if the browser is cURL or not (last updated 1.7)
17601762
* @return boolean True if the browser is cURL otherwise false
17611763
*/
1762-
protected function checkBrowserCurl ()
1764+
protected function checkBrowserCurl()
17631765
{
1764-
if (strpos($this->_agent, 'curl') === 0)
1765-
{
1766+
if (strpos($this->_agent, 'curl') === 0) {
17661767
$aresult = explode('/', stristr($this->_agent, 'curl'));
17671768
if (isset($aresult[1])) {
17681769
$aversion = explode(' ', $aresult[1]);
@@ -1793,8 +1794,8 @@ protected function checkPlatform()
17931794
$this->_platform = self::PLATFORM_ANDROID;
17941795
} elseif (stripos($this->_agent, 'Silk') !== false) {
17951796
$this->_platform = self::PLATFORM_FIRE_OS;
1796-
} elseif (stripos($this->_agent, 'linux') !== false && stripos($this->_agent, 'SMART-TV') !== false ) {
1797-
$this->_platform = self::PLATFORM_LINUX .'/'.self::PLATFORM_SMART_TV;
1797+
} elseif (stripos($this->_agent, 'linux') !== false && stripos($this->_agent, 'SMART-TV') !== false) {
1798+
$this->_platform = self::PLATFORM_LINUX . '/' . self::PLATFORM_SMART_TV;
17981799
} elseif (stripos($this->_agent, 'linux') !== false) {
17991800
$this->_platform = self::PLATFORM_LINUX;
18001801
} else if (stripos($this->_agent, 'Nokia') !== false) {
@@ -1837,4 +1838,4 @@ protected function checkPlatform()
18371838
$this->_platform = self::PLATFORM_I_FRAME;
18381839
}
18391840
}
1840-
}
1841+
}

0 commit comments

Comments
 (0)