Permalink
Browse files

Updates User Agent detection in client library.

  • Loading branch information...
JB Lebrun
JB Lebrun committed Jul 3, 2018
1 parent 504556e commit 24d5d71b4b60806baaca90c4b4ef8e5af29a5ad7
@@ -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.22
* @version 1.0.23
* @date Creation: Jun 2007
* @date Modification: Jul 2018
* @copyright 2007 - 2018 CaMykS Team
@@ -341,21 +341,13 @@ function client_getUAInfos($ua=false) {
}
/* check Motorola */
elseif (preg_match('/mot(?:-|orola |o|\-moto)([^ \/;]+)/i', $ua, $matches))
$infos = array_merge($infos, array(
'platform_company' =>'Motorola',
'platform_model' =>$matches[1],
'platform_type' =>'handheld',
'platform_format' =>'handheld',
));
elseif (preg_match('/ (Droid|MB200|RAZR HD|Moto G)/', $ua, $matches))
$infos = array_merge($infos, array(
'platform_company' => 'Motorola',
'platform_model' => $matches[1],
'platform_type' => 'handheld',
'platform_format' => 'handheld',
));
elseif (preg_match('/XT([0-9]{3,})/', $ua, $matches)) {
elseif (preg_match('/mot(?:-|orola |o|\-moto)([^ \/;]+)/i', $ua, $matches)) {
include_once('clientDevices/Motorola.php.inc');
$infos = array_merge($infos, get_MotorolaClientDevice($matches[1]));
} elseif (preg_match('/ (Droid|MB200|RAZR HD|Moto G)/', $ua, $matches)) {
include_once('clientDevices/Motorola.php.inc');
$infos = array_merge($infos, get_MotorolaClientDevice($matches[1]));
} elseif (preg_match('/XT([0-9]{3,})/', $ua, $matches)) {
include_once('clientDevices/Motorola.php.inc');
$infos = array_merge($infos, get_MotorolaClientDevice($matches[0]));
}
@@ -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.4
* @version 1.0.5
* @date Creation: May 2018
* @date Modification: Jun 2018
* @date Modification: Jul 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.
@@ -3874,6 +3874,16 @@ function _client_getKnownBots() {
'engine_url' => '',
);
/* 1001FirmsBot */
$knownBots['1001firmsbot'] = array(
'platform_type' => 'bot',
'platform_format' => 'desktop',
'bot_title' => '1001FirmsBot',
'bot_url' => 'https://www.1001firms.com/robot.php',
'engine_title' => '1001 Firms',
'engine_url' => 'https://www.1001firms.com/',
);
/* unknown bots */
/* SEOBulls - unknown bot */
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Motorola.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.1
* @version 1.0.2
* @date Creation: Apr 2018
* @date Modification: May 2018
* @date Modification: Jul 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,14 +20,20 @@
*/
function get_MotorolaClientDevice($deviceCode='') {
$deviceList = array(
'XT720' => array('platform_model' => 'Milestone XT720', 'platform_year' => 2010),
'XT1022' => array('platform_model' => 'Moto E', 'platform_year' => 2015),
'XT1031' => array('platform_model' => 'Moto G', 'platform_year' => 2013),
'XT1032' => array('platform_model' => 'Moto G', 'platform_year' => 2013),
'XT1033' => array('platform_model' => 'Moto G', 'platform_year' => 2013),
'XT1039' => array('platform_model' => 'Moto 4G', 'platform_year' => 2013),
'XT1072' => array('platform_model' => 'Moto G 4G (2nd Gen)', 'platform_year' => 2013),
'XT1092' => array('platform_model' => 'Moto X (2nd Gen)', 'platform_year' => 2014),
'XT720' => array('platform_model' => 'Milestone XT720', 'platform_year' => 2010),
'XT1022' => array('platform_model' => 'Moto E', 'platform_year' => 2014),
'XT1031' => array('platform_model' => 'Moto G', 'platform_year' => 2013),
'XT1032' => array('platform_model' => 'Moto G', 'platform_year' => 2013),
'XT1033' => array('platform_model' => 'Moto G', 'platform_year' => 2013),
'XT1039' => array('platform_model' => 'Moto 4G', 'platform_year' => 2013),
'XT1072' => array('platform_model' => 'Moto G 4G (2nd Gen)', 'platform_year' => 2013),
'XT1092' => array('platform_model' => 'Moto X (2nd Gen)', 'platform_year' => 2014),
'E2(4G-LTE)' => array('platform_model' => 'Moto E (2nd Gen)', 'platform_year' => 2015),
'Moto G' => array('platform_model' => 'Moto G', 'platform_year' => 2013),
'RAZR HD' => array('platform_model' => 'Droid Razr HD', 'platform_year' => 2012),
'Droid' => array('platform_model' => 'Droid', 'platform_year' => 2009),
'MB200' => array('platform_model' => 'Dext', 'platform_year' => 2009),
);
/* Check for returning list */

0 comments on commit 24d5d71

Please sign in to comment.