Changeset 55988 for trunk/src/wp-includes/vars.php
- Timestamp:
- 06/22/2023 02:34:56 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/vars.php
r55412 r55988 66 66 67 67 if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { 68 if ( str pos( $_SERVER['HTTP_USER_AGENT'], 'Lynx' ) !== false) {68 if ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Lynx' ) ) { 69 69 $is_lynx = true; 70 } elseif ( str pos( $_SERVER['HTTP_USER_AGENT'], 'Edg' ) !== false) {70 } elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Edg' ) ) { 71 71 $is_edge = true; 72 72 } elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chrome' ) !== false ) { … … 90 90 } elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'safari' ) !== false ) { 91 91 $is_safari = true; 92 } elseif ( ( str pos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) !== false ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Win' ) !== false) {92 } elseif ( ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) || str_contains( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) ) && str_contains( $_SERVER['HTTP_USER_AGENT'], 'Win' ) ) { 93 93 $is_winIE = true; 94 } elseif ( str pos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mac' ) !== false) {94 } elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) && str_contains( $_SERVER['HTTP_USER_AGENT'], 'Mac' ) ) { 95 95 $is_macIE = true; 96 } elseif ( str pos( $_SERVER['HTTP_USER_AGENT'], 'Gecko' ) !== false) {96 } elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Gecko' ) ) { 97 97 $is_gecko = true; 98 } elseif ( str pos( $_SERVER['HTTP_USER_AGENT'], 'Opera' ) !== false) {98 } elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Opera' ) ) { 99 99 $is_opera = true; 100 } elseif ( str pos( $_SERVER['HTTP_USER_AGENT'], 'Nav' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.' ) !== false) {100 } elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Nav' ) && str_contains( $_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.' ) ) { 101 101 $is_NS4 = true; 102 102 } … … 116 116 * @global bool $is_apache 117 117 */ 118 $is_apache = ( str pos( $_SERVER['SERVER_SOFTWARE'], 'Apache' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) !== false);118 $is_apache = ( str_contains( $_SERVER['SERVER_SOFTWARE'], 'Apache' ) || str_contains( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) ); 119 119 120 120 /** … … 123 123 * @global bool $is_nginx 124 124 */ 125 $is_nginx = ( str pos( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false);125 $is_nginx = ( str_contains( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) ); 126 126 127 127 /** … … 130 130 * @global bool $is_IIS 131 131 */ 132 $is_IIS = ! $is_apache && ( str pos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer' ) !== false);132 $is_IIS = ! $is_apache && ( str_contains( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) || str_contains( $_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer' ) ); 133 133 134 134 /** … … 149 149 if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { 150 150 $is_mobile = false; 151 } elseif ( str pos( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) !== false// Many mobile devices (all iPhone, iPad, etc.)152 || str pos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) !== false153 || str pos( $_SERVER['HTTP_USER_AGENT'], 'Silk/' ) !== false154 || str pos( $_SERVER['HTTP_USER_AGENT'], 'Kindle' ) !== false155 || str pos( $_SERVER['HTTP_USER_AGENT'], 'BlackBerry' ) !== false156 || str pos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mini' ) !== false157 || str pos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mobi' ) !== false) {151 } elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) // Many mobile devices (all iPhone, iPad, etc.) 152 || str_contains( $_SERVER['HTTP_USER_AGENT'], 'Android' ) 153 || str_contains( $_SERVER['HTTP_USER_AGENT'], 'Silk/' ) 154 || str_contains( $_SERVER['HTTP_USER_AGENT'], 'Kindle' ) 155 || str_contains( $_SERVER['HTTP_USER_AGENT'], 'BlackBerry' ) 156 || str_contains( $_SERVER['HTTP_USER_AGENT'], 'Opera Mini' ) 157 || str_contains( $_SERVER['HTTP_USER_AGENT'], 'Opera Mobi' ) ) { 158 158 $is_mobile = true; 159 159 } else {
Note: See TracChangeset
for help on using the changeset viewer.