@@ -78,6 +78,7 @@ class Browser
7878 const BROWSER_GOOGLEBOT = 'GoogleBot ' ; // http://en.wikipedia.org/wiki/Googlebot
7979 const BROWSER_CURL = 'cURL ' ; // https://en.wikipedia.org/wiki/CURL
8080 const BROWSER_WGET = 'Wget ' ; // https://en.wikipedia.org/wiki/Wget
81+ const BROWSER_UCBROWSER = 'UCBrowser ' ; // https://www.ucweb.com/
8182
8283
8384 const BROWSER_YANDEXBOT = 'YandexBot ' ; // http://yandex.com/bots
@@ -425,6 +426,7 @@ protected function checkBrowsers()
425426 // before Firefox and Chrome
426427 $ this ->checkBrowserWebTv () ||
427428 $ this ->checkBrowserBrave () ||
429+ $ this ->checkBrowserUCBrowser () ||
428430 $ this ->checkBrowserEdge () ||
429431 $ this ->checkBrowserInternetExplorer () ||
430432 $ this ->checkBrowserOpera () ||
@@ -1304,7 +1306,28 @@ protected function checkBrowserPalemoon()
13041306 }
13051307
13061308 /**
1307- * Determine if the browser is Firefox or not (last updated 1.7)
1309+ * Determine if the browser is UCBrowser or not
1310+ * @return boolean True if the browser is UCBrowser otherwise false
1311+ */
1312+ protected function checkBrowserUCBrowser ()
1313+ {
1314+ if (preg_match ('/UC ?Browser\/?([\d\.]+)/ ' , $ this ->_agent , $ matches )) {
1315+ if (isset ($ matches [1 ])) {
1316+ $ this ->setVersion ($ matches [1 ]);
1317+ }
1318+ if (stripos ($ this ->_agent , 'Mobile ' ) !== false ) {
1319+ $ this ->setMobile (true );
1320+ } else {
1321+ $ this ->setTablet (true );
1322+ }
1323+ $ this ->setBrowser (self ::BROWSER_UCBROWSER );
1324+ return true ;
1325+ }
1326+ return false ;
1327+ }
1328+
1329+ /**
1330+ * Determine if the browser is Firefox or not
13081331 * @return boolean True if the browser is Firefox otherwise false
13091332 */
13101333 protected function checkBrowserFirefox ()
0 commit comments