Permalink
Browse files

Updates user agent detection in client library.

  • Loading branch information...
JB Lebrun
JB Lebrun committed Nov 8, 2018
1 parent 667ce4a commit f51d482e78f5209a4354d01ab8ef4356b35244bf
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/client.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.42
* @version 1.0.43
* @date Creation: Jun 2007
* @date Modification: Oct 2018
* @date Modification: Nov 2018
* @copyright 2007 - 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.
@@ -595,7 +595,7 @@ function client_getUAInfos($ua=false) {
}
/* check Tecno mobiles */
elseif (preg_match('/Tecno ?([^;| ]*) Build/i', $ua, $matches)) {
elseif (preg_match('/Tecno ?([^;]*) Build/i', $ua, $matches)) {
include_once ('clientDevices/Tecno.php.inc');
$infos = array_merge($infos, get_TecnoClientDevice($matches[1]));
}
@@ -1216,7 +1216,7 @@ function client_getUAInfos($ua=false) {
);
/* check Android */
elseif (preg_match('/(?:Android|Adr)[ \/]?([^;\) ]*)/', $ua, $matches)) {
elseif (preg_match('/(?:Android;?|Adr)[ \/]?([^;\) ]*)/', $ua, $matches)) {
/* check version */
$version = isset($matches[1])?$matches[1]:'';
if ($version != '' and version_compare($version, $maxVersions['system']['Android']) > 0)
@@ -2251,7 +2251,7 @@ function _client_getUAPropertiesMaxVersions() {
* @private
*/
function _client_isOnePlusDevice($ua='') {
if (preg_match('/( ONE| ONEPLUS)? (A|E)([0-9]{4}) Build/i', $ua, $matches)) {
if (preg_match('/( ONE| ONEPLUS)? (A|E)([0-9]{4})( Build|\))/i', $ua, $matches)) {
include_once('clientDevices/OnePlus.php.inc');
if (is_OnePlusKnownDevice($matches[2].$matches[3]))
return $matches;
@@ -4,9 +4,9 @@
* @details Engine / Bot Library
* @file engine/lib/tool/clientBots/Bots.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.18
* @version 1.0.19
* @date Creation: May 2018
* @date Modification: Oct 2018
* @date Modification: Nov 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.
@@ -3994,6 +3994,16 @@ function _client_getKnownBots() {
'engine_url' => 'http://spuhex.com/',
);
/* TelegramBot */
$knownBots['telegrambot'] = array(
'platform_type' => 'bot',
'platform_format' => 'desktop',
'bot_title' => 'TelegramBot',
'bot_url' => '',
'engine_title' => 'Telegram',
'engine_url' => 'https://telegram.org',
);
/* unknown bots */
/* SEOBulls - unknown bot */
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Huawei.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.18
* @version 1.0.19
* @date Creation: Apr 2018
* @date Modification: Oct 2018
* @date Modification: Nov 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.
@@ -76,6 +76,7 @@ function get_HuaweiClientDevice($deviceCode='') {
'STF-L09' => array('platform_model' => 'Honor 9', 'platform_year' => 2017),
'LLD-L31' => array('platform_model' => 'Honor 9 Lite', 'platform_year' => 2017),
'COL-L29' => array('platform_model' => 'Honor 10', 'platform_year' => 2018),
'BKL-L09' => array('platform_model' => 'Honor View 10', 'platform_year' => 2018),
'BKL-L09S' => array('platform_model' => 'Honor View 10', 'platform_year' => 2018),
'AUM-L29' => array('platform_model' => 'Honor 7A Pro', 'platform_year' => 2018),
'Y635-L01' => array('platform_model' => 'Y635', 'platform_year' => 2015),
@@ -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.7
* @version 1.0.8
* @date Creation: Apr 2018
* @date Modification: Oct 2018
* @date Modification: Nov 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.
@@ -41,6 +41,7 @@ function get_LGClientDevice($deviceCode='') {
'E960' => array('platform_model' => 'Nexus 4', 'platform_year' => 2012),
'H812' => array('platform_model' => 'G4', 'platform_year' => 2015),
'H815' => array('platform_model' => 'G4', 'platform_year' => 2015),
'H850' => array('platform_model' => 'G5', 'platform_year' => 2016),
'H870' => array('platform_model' => 'G6', 'platform_year' => 2018),
'H870D' => array('platform_model' => 'G6', 'platform_year' => 2018),
'H955' => array('platform_model' => 'G Flex 2', 'platform_year' => 2015),
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Samsung.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.19
* @version 1.0.20
* @date Creation: Apr 2018
* @date Modification: Oct 2018
* @date Modification: Nov 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.
@@ -175,6 +175,8 @@ function get_SamsungClientDevice($deviceCode='') {
'SM-G850F' => array('platform_model' => 'Galaxy Alpha', 'platform_year' => 2014),
'SM-G850W' => array('platform_model' => 'Galaxy Alpha', 'platform_year' => 2014),
'GT-S6812' => array('platform_model' => 'Galaxy Fame Duos', 'platform_year' => 2013),
'GT-I8262D' => array('platform_model' => 'Galaxy Core Duos', 'platform_year' => 2013),
'SM-G355H' => array('platform_model' => 'Galaxy Core 2', 'platform_year' => 2014),
'SM-G355HN' => array('platform_model' => 'Galaxy Core 2', 'platform_year' => 2014),
'SM-G360F' => array('platform_model' => 'Galaxy Core Prime', 'platform_year' => 2015),
'SM-G361F' => array('platform_model' => 'Galaxy Core Prime', 'platform_year' => 2015),
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Tecno.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0
* @version 1.0.1
* @date Creation: Oct 2018
* @date Modification: Oct 2018
* @date Modification: Nov 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,8 +20,9 @@
*/
function get_TecnoClientDevice($deviceCode='') {
$deviceList = array(
'K7' => array('platform_model' => 'Spark', 'platform_year' => 2017),
'K9' => array('platform_model' => 'Spark Plus', 'platform_year' => 2017),
'K7' => array('platform_model' => 'Spark', 'platform_year' => 2017),
'K9' => array('platform_model' => 'Spark Plus', 'platform_year' => 2017),
'Camon CX' => array('platform_year' => 2018),
);
/* Check for returning list */

0 comments on commit f51d482

Please sign in to comment.