25
25
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26
26
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
27
*
28
- * @version 2.2
29
- * @last-modified July 5 , 2021
28
+ * @version 2.3
29
+ * @last-modified September 3 , 2021
30
30
* @link https://github.com/foroco/php-browser-detection
31
31
*/
32
32
@@ -213,7 +213,7 @@ private function match_mobile()
213
213
214
214
// Match other mobile signs
215
215
216
- if ($ this ->matchi_ua ('mobile|tablet ' ) || $ this ->match_ua ('BlackBerry|BB10;|MIDP|PlayBook|Windows Phone|Windows Mobile|Windows CE|IEMobile|Opera Mini|OPiOS|Opera Mobi|Kindle|Silk/|Bada|Tizen|Lumia|Symbian|SymbOS|(Series|PalmOS|PalmSource|Dolfin|Crosswalk|Obigo|MQQBrowser|CriOS ' ) || $ this ->matchi_ua ('nokia|playstation|watch ' )) $ this ->result_mobile = 1 ;
216
+ if ($ this ->matchi_ua ('mobile|tablet ' ) || $ this ->match_ua ('BlackBerry|BB10;|MIDP|PlayBook|Windows Phone|Windows Mobile|Windows CE|IEMobile|Opera Mini|OPiOS|Opera Mobi|CrKey armv| Kindle|Silk/|Bada|Tizen|Lumia|Symbian|SymbOS|(Series|PalmOS|PalmSource|Dolfin|Crosswalk|Obigo|MQQBrowser|CriOS ' ) || $ this ->matchi_ua ('nokia|playstation|watch ' )) $ this ->result_mobile = 1 ;
217
217
return NULL ;
218
218
}
219
219
@@ -376,6 +376,7 @@ private function getResult()
376
376
$ version_minor = is_array ($ matches ) ? $ matches [2 ] : 0 ;
377
377
378
378
// macOS version to minor version conversion (needs since Big Sur)
379
+ if ($ version == 10 && $ version_minor == 0 ) $ version_minor = 16 ;
379
380
if ($ version == 11 ) $ version_minor = 16 ;
380
381
if ($ version == 12 ) $ version_minor = 17 ;
381
382
@@ -417,7 +418,7 @@ private function getResult()
417
418
{
418
419
$ this ->result_os_family = 'linux ' ;
419
420
$ this ->result_os_name = $ k ;
420
- $ this ->result_os_version = ( float )$ matches [1 ];
421
+ $ this ->result_os_version = is_array ( $ matches ) ? ( float )$ matches [1 ] : 0 ;
421
422
$ os_need_continue = FALSE ;
422
423
break ;
423
424
}
@@ -431,6 +432,7 @@ private function getResult()
431
432
{
432
433
$ other_os = array ();
433
434
435
+ $ other_os [] = array ('Chrome OS ' =>'CrOS ' );
434
436
$ other_os [] = array ('Linux Mint ' =>'Linux Mint ' );
435
437
$ other_os [] = array ('Kubuntu ' =>'Kubuntu ' );
436
438
$ other_os [] = array ('Ubuntu ' =>'Ubuntu ' );
@@ -451,7 +453,6 @@ private function getResult()
451
453
$ other_os [] = array ('Linux ' =>'X11; ' );
452
454
$ other_os [] = array ('Linux ' =>'Mozilla/5.0 (x86_64) ' );
453
455
$ other_os [] = array ('Linux ' =>'Mozilla/5.0 (i686) ' );
454
- $ other_os [] = array ('Linux ' =>'CrKey armv7l ' );
455
456
$ other_os [] = array ('Linux ' =>'U; NETFLIX ' );
456
457
$ other_os [] = array ('Linux ' =>'GNU; ' );
457
458
$ other_os [] = array ('AmigaOS ' =>'AmigaOS ' );
@@ -584,7 +585,7 @@ private function getResult()
584
585
$ this ->result_os_family = 'linux ' ;
585
586
if (strpos ($ k , 'Windows ' ) !== FALSE ) $ this ->result_os_family = 'windows ' ;
586
587
$ this ->result_os_name = $ k ;
587
- $ this ->result_os_version = ( float )$ matches [1 ];
588
+ $ this ->result_os_version = is_array ( $ matches ) ? ( float )$ matches [1 ] : 0 ;
588
589
$ os_need_continue = FALSE ;
589
590
590
591
// J2ME/MIDP or MAUI
@@ -606,7 +607,8 @@ private function getResult()
606
607
{
607
608
$ other_os = array ();
608
609
609
- $ other_os [] = array ('Sailfish OS ' =>'Sailfish ' );
610
+ $ other_os [] = array ('Android ' =>'CrKey armv ' );
611
+ $ other_os [] = array ('Android ' =>'SpreadTrum; ' );
610
612
$ other_os [] = array ('BlackBerry ' =>'BlackBerry ' );
611
613
$ other_os [] = array ('BlackBerry ' =>'BB10; ' );
612
614
$ other_os [] = array ('BlackBerry ' =>'RIM Tablet ' );
@@ -617,6 +619,7 @@ private function getResult()
617
619
$ other_os [] = array ('KaiOS ' =>'KAIOS ' );
618
620
$ other_os [] = array ('RemixOS ' =>'Remix Mini ' );
619
621
$ other_os [] = array ('RemixOS ' =>'RemixOS ' );
622
+ $ other_os [] = array ('Sailfish OS ' =>'Sailfish ' );
620
623
$ other_os [] = array ('LiveArea ' =>'PlayStation Vita ' );
621
624
$ other_os [] = array ('PalmOS ' =>'PalmOS ' );
622
625
$ other_os [] = array ('PalmOS ' =>'PalmSource ' );
@@ -631,6 +634,7 @@ private function getResult()
631
634
632
635
if ($ this ->match_ua ($ v ))
633
636
{
637
+ if ($ k === 'Android ' ) $ this ->result_os_family = 'android ' ;
634
638
if ($ k === 'BlackBerry ' ) $ this ->result_os_family = 'blackberry ' ;
635
639
if ($ k === 'Symbian ' ) $ this ->result_os_family = 'symbian ' ;
636
640
if ($ k === 'WatchOS ' ) $ this ->result_os_family = 'macintosh ' ;
@@ -659,7 +663,6 @@ private function getResult()
659
663
{
660
664
$ other_os = array ();
661
665
662
- $ other_os [] = array ('Chrome OS ' =>'CrOS ' );
663
666
$ other_os [] = array ('WebOS ' =>'hpwOS ' );
664
667
$ other_os [] = array ('WebOS ' =>'Web0S ' );
665
668
$ other_os [] = array ('WebOS ' =>'WebOS ' );
0 commit comments