wp/wp-includes/vars.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-includes/vars.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/vars.php	Tue Dec 15 13:49:49 2020 +0100
@@ -10,7 +10,7 @@
  * servers with known pretty permalink capability.
  *
  * Note: Though Nginx is detected, WordPress does not currently
- * generate rewrite rules for it. See https://codex.wordpress.org/Nginx
+ * generate rewrite rules for it. See https://wordpress.org/support/article/nginx/
  *
  * @package WordPress
  */
@@ -19,9 +19,9 @@
 	$is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE, $is_edge,
 	$is_apache, $is_IIS, $is_iis7, $is_nginx;
 
-// On which page are we ?
+// On which page are we?
 if ( is_admin() ) {
-	// wp-admin pages are checked more carefully
+	// wp-admin pages are checked more carefully.
 	if ( is_network_admin() ) {
 		preg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
 	} elseif ( is_user_admin() ) {
@@ -38,7 +38,7 @@
 		preg_match( '#(.*?)(/|$)#', $pagenow, $self_matches );
 		$pagenow = strtolower( $self_matches[1] );
 		if ( '.php' !== substr( $pagenow, -4, 4 ) ) {
-			$pagenow .= '.php'; // for Options +Multiviews: /wp-admin/themes/index.php (themes.php is queried)
+			$pagenow .= '.php'; // For `Options +Multiviews`: /wp-admin/themes/index.php (themes.php is queried).
 		}
 	}
 } else {
@@ -50,8 +50,17 @@
 }
 unset( $self_matches );
 
-// Simple browser detection
-$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = $is_edge = false;
+// Simple browser detection.
+$is_lynx   = false;
+$is_gecko  = false;
+$is_winIE  = false;
+$is_macIE  = false;
+$is_opera  = false;
+$is_NS4    = false;
+$is_safari = false;
+$is_chrome = false;
+$is_iphone = false;
+$is_edge   = false;
 
 if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
 	if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Lynx' ) !== false ) {
@@ -68,7 +77,8 @@
 			 *
 			 * @param bool $is_admin Whether to use the Google Chrome Frame. Default is the value of is_admin().
 			 */
-			if ( $is_chrome = apply_filters( 'use_google_chrome_frame', $is_admin ) ) {
+			$is_chrome = apply_filters( 'use_google_chrome_frame', $is_admin );
+			if ( $is_chrome ) {
 				header( 'X-UA-Compatible: chrome=1' );
 			}
 			$is_winIE = ! $is_chrome;
@@ -96,7 +106,7 @@
 
 $is_IE = ( $is_macIE || $is_winIE );
 
-// Server detection
+// Server detection.
 
 /**
  * Whether the server software is Apache or something else
@@ -136,7 +146,7 @@
 function wp_is_mobile() {
 	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
 		$is_mobile = false;
-	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) !== false // many mobile devices (all iPhone, iPad, etc.)
+	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) !== false // Many mobile devices (all iPhone, iPad, etc.)
 		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) !== false
 		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Silk/' ) !== false
 		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Kindle' ) !== false