Permalink
Browse files

Update user agent detection in client library.

  • Loading branch information...
JB Lebrun
JB Lebrun committed Oct 12, 2018
1 parent ce42cee commit eb6cee57cd2cc6a5378154d98baa0078ee68da28
@@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/client.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.38
* @version 1.0.39
* @date Creation: Jun 2007
* @date Modification: Oct 2018
* @copyright 2007 - 2018 CaMykS Team
@@ -408,6 +408,10 @@ function client_getUAInfos($ua=false) {
include_once ('clientDevices/Sony.php.inc');
$infos = array_merge($infos, get_SonyClientDevice($matches[0]));
}
elseif (preg_match('/ (SGP[0-9a-zA-Z]{3,}) Build/', $ua, $matches)) {
include_once ('clientDevices/Sony.php.inc');
$infos = array_merge($infos, get_SonyClientDevice($matches[1]));
}
/* check Sony PCs */
elseif (preg_match('/MASE|MASEJS|MASP|MASPJS|MASA|MASAJS/', $ua, $matches))
@@ -1189,6 +1193,11 @@ function client_getUAInfos($ua=false) {
$model = trim($matches[1]);
$infos = array_merge($infos, get_MeizuClientDevice($model));
}
elseif (preg_match('/ (M3s) Build/', $ua, $matches)) {
include_once ('clientDevices/Meizu.php.inc');
$model = trim($matches[1]);
$infos = array_merge($infos, get_MeizuClientDevice($model));
}
/* check Symphony mobiles */
elseif (preg_match('/ ([iEHG][0-9]{2,3}) Build/i', $ua, $matches)) {
@@ -1455,8 +1464,8 @@ function client_getUAInfos($ua=false) {
}
/* check Chrome/Safari/Firefox/Explorer compatible browsers, to be tested before usual browsers */
elseif (preg_match('/(YaBrowser|OPR|IceDragon|Dragon|CriOS|Adventurer|Sleipnir|BoBrowser|Dolfin|ChromePlus|Phoenix|Shiretoko|NS8|MiuiBrowser|SamsungBrowser\/CrossApp|SamsungBrowser|Vivaldi|Qt|Iceweasel|Puffin|Firebird|FBAV|FBSV|app-ipad-CoteMaison|QQBrowser|PaleMoon|Arora|Edge|Cheshire|MicroMessenger|Getter|Dooble|amaya|Roccat|QupZilla|MMS|Iron|ACHEETAHI|OPiOS|Beonex|LibertyBrowser|LinkedIn|SeaMonkey|Cyberfox|Focus|Fennec|K-Meleon|CoolNovo|QuickLook|GSA|Electron|NG|FxiOS|Lotus-Notes|Chimera|Epiphany|Iridium|HeadlessChrome|QwantiOS|Blazer|TenFourFox|Silk|SailfishBrowser|coc_coc_browser|MZBrowser|2345Explorer|Kinza|WebPositive)\/([a-z0-9\._]*)?/i', $ua, $matches)) {
$rep = array('OPR'=>'Opera', 'CriOS'=>'Chrome', 'Dragon'=>'IceDragon', 'NS8'=>'Netscape', 'Firebird'=>'Thunderbird', 'FBAV'=>'Facebook App', 'FBSV'=>'Facebook App', 'app-ipad-CoteMaison'=>'C&ocirc;t&eacute; Maison App', 'amaya'=>'Amaya', 'MMS'=>'Opera Neon', 'ACHEETAHI'=>'CM Browser', 'OPiOS'=>'Opera mini', 'Focus'=>'Firefox Focus', 'GSA'=>'Google Search App', 'NG'=>'Browser NG', 'FxiOS'=>'Firefox', 'Lotus-Notes'=>'Lotus Notes', 'QwantiOS'=>'Qwant', 'Blazer'=> 'Palm Blazer', 'MicroMessenger' => 'WeChat', 'SailfishBrowser' => 'Sailfish Browser', 'coc_coc_browser'=>'C&ocirc;c c&ocirc;c', 'MZBrowser' => 'Meizu Browser');
elseif (preg_match('/(YaBrowser|OPR|IceDragon|Dragon|CriOS|Adventurer|Sleipnir|BoBrowser|Dolfin|ChromePlus|Phoenix|Shiretoko|NS8|MiuiBrowser|SamsungBrowser\/CrossApp|SamsungBrowser|Vivaldi|Qt|Iceweasel|Puffin|Firebird|FBAV|FBSV|app-ipad-CoteMaison|QQBrowser|PaleMoon|Arora|Edge|Cheshire|MicroMessenger|Getter|Dooble|amaya|Roccat|QupZilla|MMS|Iron|ACHEETAHI|OPiOS|Beonex|LibertyBrowser|LinkedIn|SeaMonkey|Cyberfox|Focus|Fennec|K-Meleon|CoolNovo|QuickLook|GSA|Electron|NG|FxiOS|FocusiOS|Lotus-Notes|Chimera|Epiphany|Iridium|HeadlessChrome|QwantiOS|Blazer|TenFourFox|Silk|SailfishBrowser|coc_coc_browser|MZBrowser|2345Explorer|Kinza|WebPositive)\/([a-z0-9\._]*)?/i', $ua, $matches)) {
$rep = array('OPR'=>'Opera', 'CriOS'=>'Chrome', 'Dragon'=>'IceDragon', 'NS8'=>'Netscape', 'Firebird'=>'Thunderbird', 'FBAV'=>'Facebook App', 'FBSV'=>'Facebook App', 'app-ipad-CoteMaison'=>'C&ocirc;t&eacute; Maison App', 'amaya'=>'Amaya', 'MMS'=>'Opera Neon', 'ACHEETAHI'=>'CM Browser', 'OPiOS'=>'Opera mini', 'Focus'=>'Firefox Focus', 'GSA'=>'Google Search App', 'NG'=>'Browser NG', 'FxiOS'=>'Firefox', 'FocusiOS'=>'Firefox Focus', 'Lotus-Notes'=>'Lotus Notes', 'QwantiOS'=>'Qwant', 'Blazer'=> 'Palm Blazer', 'MicroMessenger' => 'WeChat', 'SailfishBrowser' => 'Sailfish Browser', 'coc_coc_browser'=>'C&ocirc;c c&ocirc;c', 'MZBrowser' => 'Meizu Browser');
$infos = array_merge($infos, array(
'browser_title' => isset($rep[$matches[1]])?$rep[$matches[1]]:$matches[1],
'browser_version' => isset($matches[2])?$matches[2]:'',
@@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Huawei.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.15
* @version 1.0.16
* @date Creation: Apr 2018
* @date Modification: Oct 2018
* @copyright 2018 CaMykS Team
@@ -48,6 +48,7 @@ function get_HuaweiClientDevice($deviceCode='') {
'EML-L29' => array('platform_model' => 'P20', 'platform_year' => 2018),
'ANE-LX1' => array('platform_model' => 'P20 Lite', 'platform_year' => 2018),
'ANE-LX3' => array('platform_model' => 'P20 Lite', 'platform_year' => 2018),
'CLT-L09' => array('platform_model' => 'P20 Pro', 'platform_year' => 2018),
'CLT-L29' => array('platform_model' => 'P20 Pro', 'platform_year' => 2018),
'NXT-L09' => array('platform_model' => 'Mate 8', 'platform_year' => 2015),
'NXT-L29' => array('platform_model' => 'Mate 8', 'platform_year' => 2015),
@@ -87,6 +88,7 @@ function get_HuaweiClientDevice($deviceCode='') {
'CUN-L03' => array('platform_model' => 'Y5 II', 'platform_year' => 2016),
'SCL-L01' => array('platform_model' => 'Y6', 'platform_year' => 2015),
'SCL-U31' => array('platform_model' => 'Y6', 'platform_year' => 2015),
'MYA-L11' => array('platform_model' => 'Y6', 'platform_year' => 2017),
'MYA-L41' => array('platform_model' => 'Y6', 'platform_year' => 2017),
'LYO-L01' => array('platform_model' => 'Y6 II Compact', 'platform_year' => 2016),
'TRT-LX2' => array('platform_model' => 'Y7', 'platform_year' => 2017),
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/LG.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.5
* @version 1.0.6
* @date Creation: Apr 2018
* @date Modification: Sep 2018
* @date Modification: Oct 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -42,13 +42,14 @@ function get_LGClientDevice($deviceCode='') {
'H812' => array('platform_model' => 'G4', 'platform_year' => 2015),
'H815' => array('platform_model' => 'G4', 'platform_year' => 2015),
'H870D' => array('platform_model' => 'G6', 'platform_year' => 2018),
'H955' => array('platform_model' => 'G Flex 2', 'platform_year' => 2015),
'L160L' => array('platform_model' => 'Optimus LTE2', 'platform_year' => 2018),
'LS996' => array('platform_model' => 'G Flex 2', 'platform_year' => 2015),
'K371' => array('platform_model' => 'Phoenix 2', 'platform_year' => 2016),
'M700' => array('platform_model' => 'Q6 Alpha', 'platform_year' => 2017),
'M160' => array('platform_model' => 'K4', 'platform_year' => 2017),
'P715' => array('platform_model' => 'Optimus L7 II', 'platform_year' => 2013),
'P875' => array('platform_model' => 'Optimus F5', 'platform_year' => 2013),
'LS996' => array('platform_model' => 'G Flex 2', 'platform_year' => 2015),
'H955' => array('platform_model' => 'G Flex 2', 'platform_year' => 2015),
'VS986' => array('platform_model' => 'G4', 'platform_year' => 2015),
);
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Meizu.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0
* @version 1.0.1
* @date Creation: Sep 2018
* @date Modification: Sep 2018
* @date Modification: Oct 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -20,7 +20,8 @@
*/
function get_MeizuClientDevice($deviceCode='') {
$deviceList = array(
'MZ-PRO 6' => array('platform_model' => 'Pro 6', 'platform_year' => 2016),
'MZ-PRO 6' => array('platform_model' => 'Pro 6', 'platform_year' => 2016),
'M3s' => array('platform_model' => 'M3s', 'platform_year' => 2016),
);
/* Check for returning list */
@@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Sony.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.11
* @version 1.0.12
* @date Creation: Apr 2018
* @date Modification: Oct 2018
* @copyright 2018 CaMykS Team
@@ -20,6 +20,10 @@
*/
function get_SonyClientDevice($deviceCode='') {
$deviceList = array(
/* Sony tablets */
'SGP712' => array('platform_model' => 'Xperia Z4 Tablet', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2015),
/* Sony phones */
'C1505' => array('platform_model' => 'Xperia E', 'platform_year' => 2013),
'C2105' => array('platform_model' => 'Xperia L', 'platform_year' => 2013),
'C5303' => array('platform_model' => 'Xperia SP', 'platform_year' => 2013),
@@ -36,6 +40,7 @@ function get_SonyClientDevice($deviceCode='') {
'D6603' => array('platform_model' => 'Xperia Z3', 'platform_year' => 2014),
'D6683' => array('platform_model' => 'Xperia Z3 Dual Sim', 'platform_year' => 2015),
'E5303' => array('platform_model' => 'Xperia C4', 'platform_year' => 2015),
'E5603' => array('platform_model' => 'Xperia M5', 'platform_year' => 2015),
'E5823' => array('platform_model' => 'Xperia Z5 Compact', 'platform_year' => 2015),
'E6653' => array('platform_model' => 'Xperia Z5', 'platform_year' => 2015),
'E6683' => array('platform_model' => 'Xperia Z5', 'platform_year' => 2015),

0 comments on commit eb6cee5

Please sign in to comment.