@@ -543,8 +543,8 @@ public function match($userAgent = null, $accept = null)
543543 * user agent string, which we can use to look for mobile agents.
544544 */
545545 if (
546- strpos ($ this ->agent , 'MOT- ' ) !== false
547- || strpos ($ this ->lowerAgent , 'j- ' ) !== false
546+ str_contains ($ this ->agent , 'MOT- ' )
547+ || str_contains ($ this ->lowerAgent , 'j- ' )
548548 || preg_match ('/(mobileexplorer|openwave|opera mini|opera mobi|operamini|avantgo|wap|elaine)/i ' , $ this ->agent )
549549 || preg_match ('/(iPhone|iPod|iPad|Android|Mobile|Phone|BlackBerry|Xiino|Palmscape|palmsource)/i ' , $ this ->agent )
550550 || preg_match ('/(Nokia|Ericsson|docomo|digital paths|portalmmm|CriOS[\/ ]([0-9.]+))/i ' , $ this ->agent )
@@ -561,7 +561,7 @@ public function match($userAgent = null, $accept = null)
561561 if (preg_match ('|Edge\/([0-9.]+)| ' , $ this ->agent , $ version )) {
562562 $ this ->setBrowser ('edge ' );
563563
564- if (strpos ($ version [1 ], '. ' ) !== false ) {
564+ if (str_contains ($ version [1 ], '. ' )) {
565565 list ($ this ->majorVersion , $ this ->minorVersion ) = explode ('. ' , $ version [1 ]);
566566 } else {
567567 $ this ->majorVersion = $ version [1 ];
@@ -601,9 +601,9 @@ public function match($userAgent = null, $accept = null)
601601
602602 list ($ this ->majorVersion , $ this ->minorVersion ) = explode ('. ' , $ version [1 ]);
603603 } elseif (
604- strpos ($ this ->lowerAgent , 'elaine/ ' ) !== false
605- || strpos ($ this ->lowerAgent , 'palmsource ' ) !== false
606- || strpos ($ this ->lowerAgent , 'digital paths ' ) !== false
604+ str_contains ($ this ->lowerAgent , 'elaine/ ' )
605+ || str_contains ($ this ->lowerAgent , 'palmsource ' )
606+ || str_contains ($ this ->lowerAgent , 'digital paths ' )
607607 ) {
608608 $ this ->setBrowser ('palm ' );
609609 } elseif (
@@ -615,11 +615,11 @@ public function match($userAgent = null, $accept = null)
615615 $ this ->setBrowser ('msie ' );
616616
617617 // Special case for IE 11+
618- if (strpos ($ version [0 ], 'Trident ' ) !== false && strpos ($ version [0 ], 'rv: ' ) !== false ) {
618+ if (str_contains ($ version [0 ], 'Trident ' ) && str_contains ($ version [0 ], 'rv: ' )) {
619619 preg_match ('|rv:([0-9.]+)| ' , $ this ->agent , $ version );
620620 }
621621
622- if (strpos ($ version [1 ], '. ' ) !== false ) {
622+ if (str_contains ($ version [1 ], '. ' )) {
623623 list ($ this ->majorVersion , $ this ->minorVersion ) = explode ('. ' , $ version [1 ]);
624624 } else {
625625 $ this ->majorVersion = $ version [1 ];
@@ -634,7 +634,7 @@ public function match($userAgent = null, $accept = null)
634634 }
635635 } elseif (preg_match ('|ANTFresco\/([0-9]+)| ' , $ this ->agent , $ version )) {
636636 $ this ->setBrowser ('fresco ' );
637- } elseif (strpos ($ this ->lowerAgent , 'avantgo ' ) !== false ) {
637+ } elseif (str_contains ($ this ->lowerAgent , 'avantgo ' )) {
638638 $ this ->setBrowser ('avantgo ' );
639639 } elseif (preg_match ('|[Kk]onqueror\/([0-9]+)| ' , $ this ->agent , $ version ) || preg_match ('|Safari/([0-9]+)\.?([0-9]+)?| ' , $ this ->agent , $ version )) {
640640 // Konqueror and Apple's Safari both use the KHTML rendering engine.
@@ -645,7 +645,7 @@ public function match($userAgent = null, $accept = null)
645645 $ this ->minorVersion = $ version [2 ];
646646 }
647647
648- if (strpos ($ this ->agent , 'Safari ' ) !== false && $ this ->majorVersion >= 60 ) {
648+ if (str_contains ($ this ->agent , 'Safari ' ) && $ this ->majorVersion >= 60 ) {
649649 // Safari.
650650 $ this ->setBrowser ('safari ' );
651651 $ this ->identifyBrowserVersion ();
@@ -660,25 +660,25 @@ public function match($userAgent = null, $accept = null)
660660 $ this ->setBrowser ('links ' );
661661 } elseif (preg_match ('|HotJava\/([0-9]+)| ' , $ this ->agent , $ version )) {
662662 $ this ->setBrowser ('hotjava ' );
663- } elseif (strpos ($ this ->agent , 'UP/ ' ) !== false || strpos ($ this ->agent , 'UP.B ' ) !== false || strpos ($ this ->agent , 'UP.L ' ) !== false ) {
663+ } elseif (str_contains ($ this ->agent , 'UP/ ' ) || str_contains ($ this ->agent , 'UP.B ' ) || str_contains ($ this ->agent , 'UP.L ' )) {
664664 $ this ->setBrowser ('up ' );
665- } elseif (strpos ($ this ->agent , 'Xiino/ ' ) !== false ) {
665+ } elseif (str_contains ($ this ->agent , 'Xiino/ ' )) {
666666 $ this ->setBrowser ('xiino ' );
667- } elseif (strpos ($ this ->agent , 'Palmscape/ ' ) !== false ) {
667+ } elseif (str_contains ($ this ->agent , 'Palmscape/ ' )) {
668668 $ this ->setBrowser ('palmscape ' );
669- } elseif (strpos ($ this ->agent , 'Nokia ' ) !== false ) {
669+ } elseif (str_contains ($ this ->agent , 'Nokia ' )) {
670670 $ this ->setBrowser ('nokia ' );
671- } elseif (strpos ($ this ->agent , 'Ericsson ' ) !== false ) {
671+ } elseif (str_contains ($ this ->agent , 'Ericsson ' )) {
672672 $ this ->setBrowser ('ericsson ' );
673- } elseif (strpos ($ this ->lowerAgent , 'wap ' ) !== false ) {
673+ } elseif (str_contains ($ this ->lowerAgent , 'wap ' )) {
674674 $ this ->setBrowser ('wap ' );
675- } elseif (strpos ($ this ->lowerAgent , 'docomo ' ) !== false || strpos ($ this ->lowerAgent , 'portalmmm ' ) !== false ) {
675+ } elseif (str_contains ($ this ->lowerAgent , 'docomo ' ) || str_contains ($ this ->lowerAgent , 'portalmmm ' )) {
676676 $ this ->setBrowser ('imode ' );
677- } elseif (strpos ($ this ->agent , 'BlackBerry ' ) !== false ) {
677+ } elseif (str_contains ($ this ->agent , 'BlackBerry ' )) {
678678 $ this ->setBrowser ('blackberry ' );
679- } elseif (strpos ($ this ->agent , 'MOT- ' ) !== false ) {
679+ } elseif (str_contains ($ this ->agent , 'MOT- ' )) {
680680 $ this ->setBrowser ('motorola ' );
681- } elseif (strpos ($ this ->lowerAgent , 'j- ' ) !== false ) {
681+ } elseif (str_contains ($ this ->lowerAgent , 'j- ' )) {
682682 $ this ->setBrowser ('mml ' );
683683 } elseif (preg_match ('|Mozilla\/([0-9.]+)| ' , $ this ->agent , $ version )) {
684684 $ this ->setBrowser ('mozilla ' );
@@ -701,9 +701,9 @@ public function match($userAgent = null, $accept = null)
701701 */
702702 protected function _setPlatform ()
703703 {
704- if (strpos ($ this ->lowerAgent , 'wind ' ) !== false ) {
704+ if (str_contains ($ this ->lowerAgent , 'wind ' )) {
705705 $ this ->platform = 'win ' ;
706- } elseif (strpos ($ this ->lowerAgent , 'mac ' ) !== false ) {
706+ } elseif (str_contains ($ this ->lowerAgent , 'mac ' )) {
707707 $ this ->platform = 'mac ' ;
708708 } else {
709709 $ this ->platform = 'unix ' ;
@@ -854,11 +854,11 @@ public function isViewable($mimetype)
854854 if (!empty ($ this ->accept )) {
855855 $ wildcard_match = false ;
856856
857- if (strpos ($ this ->accept , $ mimetype ) !== false ) {
857+ if (str_contains ($ this ->accept , $ mimetype )) {
858858 return true ;
859859 }
860860
861- if (strpos ($ this ->accept , '*/* ' ) !== false ) {
861+ if (str_contains ($ this ->accept , '*/* ' )) {
862862 $ wildcard_match = true ;
863863
864864 if ($ type !== 'image ' ) {
@@ -867,7 +867,7 @@ public function isViewable($mimetype)
867867 }
868868
869869 // Deal with Mozilla pjpeg/jpeg issue
870- if ($ this ->isBrowser ('mozilla ' ) && ($ mimetype === 'image/pjpeg ' ) && (strpos ($ this ->accept , 'image/jpeg ' ) !== false )) {
870+ if ($ this ->isBrowser ('mozilla ' ) && ($ mimetype === 'image/pjpeg ' ) && (str_contains ($ this ->accept , 'image/jpeg ' ))) {
871871 return true ;
872872 }
873873
0 commit comments