diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/load.php --- a/wp/wp-includes/load.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/load.php Tue Dec 15 13:49:49 2020 +0100 @@ -13,40 +13,14 @@ * @return string The HTTP protocol. Default: HTTP/1.0. */ function wp_get_server_protocol() { - $protocol = $_SERVER['SERVER_PROTOCOL']; - if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) { + $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : ''; + if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) { $protocol = 'HTTP/1.0'; } return $protocol; } /** - * Turn register globals off. - * - * @since 2.1.0 - * @access private - */ -function wp_unregister_GLOBALS() { - if ( ! ini_get( 'register_globals' ) ) { - return; - } - - if ( isset( $_REQUEST['GLOBALS'] ) ) { - die( 'GLOBALS overwrite attempt detected' ); - } - - // Variables that shouldn't be unset - $no_unset = array( 'GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix' ); - - $input = array_merge( $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset( $_SESSION ) && is_array( $_SESSION ) ? $_SESSION : array() ); - foreach ( $input as $k => $v ) { - if ( ! in_array( $k, $no_unset ) && isset( $GLOBALS[ $k ] ) ) { - unset( $GLOBALS[ $k ] ); - } - } -} - -/** * Fix `$_SERVER` variables for various setups. * * @since 3.0.0 @@ -65,22 +39,22 @@ $_SERVER = array_merge( $default_server_values, $_SERVER ); - // Fix for IIS when running with PHP ISAPI - if ( empty( $_SERVER['REQUEST_URI'] ) || ( PHP_SAPI != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { + // Fix for IIS when running with PHP ISAPI. + if ( empty( $_SERVER['REQUEST_URI'] ) || ( 'cgi-fcgi' !== PHP_SAPI && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) { - // IIS Mod-Rewrite + // IIS Mod-Rewrite. $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; } elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) { - // IIS Isapi_Rewrite + // IIS Isapi_Rewrite. $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; } else { - // Use ORIG_PATH_INFO if there is no PATH_INFO + // Use ORIG_PATH_INFO if there is no PATH_INFO. if ( ! isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) ) { $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; } - // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice) + // Some IIS + PHP configurations put the script-name in the path-info (no need to append it twice). if ( isset( $_SERVER['PATH_INFO'] ) ) { if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) { $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO']; @@ -89,27 +63,28 @@ } } - // Append the query string if it exists and isn't null + // Append the query string if it exists and isn't null. if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; } } } - // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests + // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests. if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) ) { $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; } - // Fix for Dreamhost and other PHP as CGI hosts + // Fix for Dreamhost and other PHP as CGI hosts. if ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false ) { unset( $_SERVER['PATH_INFO'] ); } - // Fix empty PHP_SELF + // Fix empty PHP_SELF. $PHP_SELF = $_SERVER['PHP_SELF']; if ( empty( $PHP_SELF ) ) { - $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER['REQUEST_URI'] ); + $_SERVER['PHP_SELF'] = preg_replace( '/(\?.*)?$/', '', $_SERVER['REQUEST_URI'] ); + $PHP_SELF = $_SERVER['PHP_SELF']; } } @@ -130,18 +105,15 @@ $php_version = phpversion(); if ( version_compare( $required_php_version, $php_version, '>' ) ) { - wp_load_translations_early(); - $protocol = wp_get_server_protocol(); header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 ); header( 'Content-Type: text/html; charset=utf-8' ); - /* translators: 1: Current PHP version number, 2: WordPress version number, 3: Minimum required PHP version number */ - printf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version ); + printf( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.', $php_version, $wp_version, $required_php_version ); exit( 1 ); } if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) { - require_once( ABSPATH . WPINC . '/functions.php' ); + require_once ABSPATH . WPINC . '/functions.php'; wp_load_translations_early(); $args = array( 'exit' => false, @@ -149,7 +121,7 @@ ); wp_die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ), - __( 'Insufficient Requirements' ), + __( 'Requirements Not Met' ), $args ); exit( 1 ); @@ -157,14 +129,81 @@ } /** + * Retrieves the current environment type. + * + * The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable, + * or a constant of the same name. + * + * Possible values include 'local', 'development', 'staging', 'production'. + * If not set, the type defaults to 'production'. + * + * @since 5.5.0 + * @since 5.5.1 Added the 'local' type. + * @since 5.5.1 Removed the ability to alter the list of types. + * + * @return string The current environment type. + */ +function wp_get_environment_type() { + static $current_env = ''; + + if ( $current_env ) { + return $current_env; + } + + $wp_environments = array( + 'local', + 'development', + 'staging', + 'production', + ); + + // Add a note about the deprecated WP_ENVIRONMENT_TYPES constant. + if ( defined( 'WP_ENVIRONMENT_TYPES' ) && function_exists( '_deprecated_argument' ) ) { + if ( function_exists( '__' ) ) { + /* translators: %s: WP_ENVIRONMENT_TYPES */ + $message = sprintf( __( 'The %s constant is no longer supported.' ), 'WP_ENVIRONMENT_TYPES' ); + } else { + $message = sprintf( 'The %s constant is no longer supported.', 'WP_ENVIRONMENT_TYPES' ); + } + + _deprecated_argument( + 'define()', + '5.5.1', + $message + ); + } + + // Check if the environment variable has been set, if `getenv` is available on the system. + if ( function_exists( 'getenv' ) ) { + $has_env = getenv( 'WP_ENVIRONMENT_TYPE' ); + if ( false !== $has_env ) { + $current_env = $has_env; + } + } + + // Fetch the environment from a constant, this overrides the global system variable. + if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) { + $current_env = WP_ENVIRONMENT_TYPE; + } + + // Make sure the environment is an allowed one, and not accidentally set to an invalid value. + if ( ! in_array( $current_env, $wp_environments, true ) ) { + $current_env = 'production'; + } + + return $current_env; +} + +/** * Don't load all of WordPress when handling a favicon.ico request. * * Instead, send the headers for a zero-length favicon and bail. * * @since 3.0.0 + * @deprecated 5.4.0 Deprecated in favor of do_favicon(). */ function wp_favicon_request() { - if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) { + if ( '/favicon.ico' === $_SERVER['REQUEST_URI'] ) { header( 'Content-Type: image/vnd.microsoft.icon' ); exit; } @@ -173,30 +212,60 @@ /** * Die with a maintenance message when conditions are met. * - * Checks for a file in the WordPress root directory named ".maintenance". - * This file will contain the variable $upgrading, set to the time the file - * was created. If the file was created less than 10 minutes ago, WordPress - * enters maintenance mode and displays a message. - * * The default message can be replaced by using a drop-in (maintenance.php in * the wp-content directory). * * @since 3.0.0 * @access private - * - * @global int $upgrading the unix timestamp marking when upgrading WordPress began. */ function wp_maintenance() { - if ( ! file_exists( ABSPATH . '.maintenance' ) || wp_installing() ) { + // Return if maintenance mode is disabled. + if ( ! wp_is_maintenance_mode() ) { return; } + if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { + require_once WP_CONTENT_DIR . '/maintenance.php'; + die(); + } + + require_once ABSPATH . WPINC . '/functions.php'; + wp_load_translations_early(); + + header( 'Retry-After: 600' ); + + wp_die( + __( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ), + __( 'Maintenance' ), + 503 + ); +} + +/** + * Check if maintenance mode is enabled. + * + * Checks for a file in the WordPress root directory named ".maintenance". + * This file will contain the variable $upgrading, set to the time the file + * was created. If the file was created less than 10 minutes ago, WordPress + * is in maintenance mode. + * + * @since 5.5.0 + * + * @global int $upgrading The Unix timestamp marking when upgrading WordPress began. + * + * @return bool True if maintenance mode is enabled, false otherwise. + */ +function wp_is_maintenance_mode() { global $upgrading; - include( ABSPATH . '.maintenance' ); - // If the $upgrading timestamp is older than 10 minutes, don't die. - if ( ( time() - $upgrading ) >= 600 ) { - return; + if ( ! file_exists( ABSPATH . '.maintenance' ) || wp_installing() ) { + return false; + } + + require ABSPATH . '.maintenance'; + // If the $upgrading timestamp is older than 10 minutes, consider maintenance over. + if ( ( time() - $upgrading ) >= 10 * MINUTE_IN_SECONDS ) { + return false; } /** @@ -213,24 +282,10 @@ * @param int $upgrading The timestamp set in the .maintenance file. */ if ( ! apply_filters( 'enable_maintenance_mode', true, $upgrading ) ) { - return; - } - - if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { - require_once( WP_CONTENT_DIR . '/maintenance.php' ); - die(); + return false; } - require_once( ABSPATH . WPINC . '/functions.php' ); - wp_load_translations_early(); - - header( 'Retry-After: 600' ); - - wp_die( - __( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ), - __( 'Maintenance' ), - 503 - ); + return true; } /** @@ -314,7 +369,7 @@ * * This filter runs before it can be used by plugins. It is designed for * non-web run-times. Returning false causes the `WP_DEBUG` and related - * constants to not be checked and the default php values for errors + * constants to not be checked and the default PHP values for errors * will be used unless you take care to update them yourself. * * @since 4.6.0 @@ -351,7 +406,7 @@ } if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() || wp_is_json_request() ) { - @ini_set( 'display_errors', 0 ); + ini_set( 'display_errors', 0 ); } } @@ -405,14 +460,14 @@ * * @since 2.5.0 * - * @global wpdb $wpdb The WordPress database class. + * @global wpdb $wpdb WordPress database abstraction object. */ function require_wp_db() { global $wpdb; - require_once( ABSPATH . WPINC . '/wp-db.php' ); + require_once ABSPATH . WPINC . '/wp-db.php'; if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) { - require_once( WP_CONTENT_DIR . '/db.php' ); + require_once WP_CONTENT_DIR . '/db.php'; } if ( isset( $wpdb ) ) { @@ -436,7 +491,7 @@ * @since 3.0.0 * @access private * - * @global wpdb $wpdb The WordPress database class. + * @global wpdb $wpdb WordPress database abstraction object. * @global string $table_prefix The database table prefix. */ function wp_set_wpdb_vars() { @@ -472,7 +527,7 @@ 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d', - // multisite: + // Multisite: 'active' => '%d', 'cat_id' => '%d', 'deleted' => '%d', @@ -488,9 +543,9 @@ if ( is_wp_error( $prefix ) ) { wp_load_translations_early(); wp_die( - /* translators: 1: $table_prefix, 2: wp-config.php */ sprintf( - __( 'ERROR: %1$s in %2$s can only contain numbers, letters, and underscores.' ), + /* translators: 1: $table_prefix, 2: wp-config.php */ + __( 'Error: %1$s in %2$s can only contain numbers, letters, and underscores.' ), '$table_prefix', 'wp-config.php' ) @@ -545,12 +600,12 @@ * that an external object cache is being used. */ if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { - require_once( WP_CONTENT_DIR . '/object-cache.php' ); + require_once WP_CONTENT_DIR . '/object-cache.php'; if ( function_exists( 'wp_cache_init' ) ) { wp_using_ext_object_cache( true ); } - // Re-initialize any hooks added manually by object-cache.php + // Re-initialize any hooks added manually by object-cache.php. if ( $wp_filter ) { $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter ); } @@ -567,9 +622,11 @@ } if ( ! wp_using_ext_object_cache() ) { - require_once( ABSPATH . WPINC . '/cache.php' ); + require_once ABSPATH . WPINC . '/cache.php'; } + require_once ABSPATH . WPINC . '/cache-compat.php'; + /* * If cache supports reset, reset instead of init if already * initialized. Reset signals to the cache that global IDs @@ -607,8 +664,8 @@ } elseif ( ! is_blog_installed() && ! wp_installing() ) { nocache_headers(); - require( ABSPATH . WPINC . '/kses.php' ); - require( ABSPATH . WPINC . '/pluggable.php' ); + require ABSPATH . WPINC . '/kses.php'; + require ABSPATH . WPINC . '/pluggable.php'; $link = wp_guess_url() . '/wp-admin/install.php'; @@ -627,18 +684,19 @@ * @since 3.0.0 * @access private * - * @return array Files to include. + * @return string[] Array of absolute paths of files to include. */ function wp_get_mu_plugins() { $mu_plugins = array(); if ( ! is_dir( WPMU_PLUGIN_DIR ) ) { return $mu_plugins; } - if ( ! $dh = opendir( WPMU_PLUGIN_DIR ) ) { + $dh = opendir( WPMU_PLUGIN_DIR ); + if ( ! $dh ) { return $mu_plugins; } while ( ( $plugin = readdir( $dh ) ) !== false ) { - if ( substr( $plugin, -4 ) == '.php' ) { + if ( '.php' === substr( $plugin, -4 ) ) { $mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin; } } @@ -660,13 +718,13 @@ * @since 3.0.0 * @access private * - * @return string[] $plugin_file Array of paths to plugin files relative to the plugins directory. + * @return string[] Array of paths to plugin files relative to the plugins directory. */ function wp_get_active_and_valid_plugins() { $plugins = array(); $active_plugins = (array) get_option( 'active_plugins', array() ); - // Check for hacks file if the option is enabled + // Check for hacks file if the option is enabled. if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { _deprecated_file( 'my-hacks.php', '1.5.0' ); array_unshift( $plugins, ABSPATH . 'my-hacks.php' ); @@ -679,11 +737,11 @@ $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false; foreach ( $active_plugins as $plugin ) { - if ( ! validate_file( $plugin ) // $plugin must validate as file - && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' - && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist - // not already included as a network plugin - && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) ) + if ( ! validate_file( $plugin ) // $plugin must validate as file. + && '.php' === substr( $plugin, -4 ) // $plugin must end with '.php'. + && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist. + // Not already included as a network plugin. + && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins, true ) ) ) { $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; } @@ -705,8 +763,8 @@ * * @since 5.2.0 * - * @param array $plugins List of absolute plugin main file paths. - * @return array Filtered value of $plugins, without any paused plugins. + * @param string[] $plugins Array of absolute plugin main file paths. + * @return string[] Filtered array of plugins, without any paused plugins. */ function wp_skip_paused_plugins( array $plugins ) { $paused_plugins = wp_paused_plugins()->get_all(); @@ -737,7 +795,7 @@ * @since 5.1.0 * @access private * - * @return array Array of paths to theme directories. + * @return string[] Array of absolute paths to theme directories. */ function wp_get_active_and_valid_themes() { global $pagenow; @@ -775,8 +833,8 @@ * * @since 5.2.0 * - * @param array $themes List of absolute theme directory paths. - * @return array Filtered value of $themes, without any paused themes. + * @param string[] $themes Array of absolute theme directory paths. + * @return string[] Filtered array of absolute paths to themes, without any paused themes. */ function wp_skip_paused_themes( array $themes ) { $paused_themes = wp_paused_themes()->get_all(); @@ -830,7 +888,7 @@ return true; } - // Protect AJAX actions that could help resolve a fatal error should be available. + // Protect Ajax actions that could help resolve a fatal error should be available. if ( is_protected_ajax_action() ) { return true; } @@ -840,21 +898,22 @@ * * This filter is only fired when an endpoint is requested which is not already protected by * WordPress core. As such, it exclusively allows providing further protected endpoints in - * addition to the admin backend, login pages and protected AJAX actions. + * addition to the admin backend, login pages and protected Ajax actions. * * @since 5.2.0 * - * @param bool $is_protected_endpoint Whether the currently requested endpoint is protected. Default false. + * @param bool $is_protected_endpoint Whether the currently requested endpoint is protected. + * Default false. */ return (bool) apply_filters( 'is_protected_endpoint', false ); } /** - * Determines whether we are currently handling an AJAX action that should be protected against WSODs. + * Determines whether we are currently handling an Ajax action that should be protected against WSODs. * * @since 5.2.0 * - * @return bool True if the current AJAX action should be protected. + * @return bool True if the current Ajax action should be protected. */ function is_protected_ajax_action() { if ( ! wp_doing_ajax() ) { @@ -877,13 +936,13 @@ ); /** - * Filters the array of protected AJAX actions. + * Filters the array of protected Ajax actions. * - * This filter is only fired when doing AJAX and the AJAX request has an 'action' property. + * This filter is only fired when doing Ajax and the Ajax request has an 'action' property. * * @since 5.2.0 * - * @param array $actions_to_protect Array of strings with AJAX actions to protect. + * @param string[] $actions_to_protect Array of strings with Ajax actions to protect. */ $actions_to_protect = (array) apply_filters( 'wp_protected_ajax_actions', $actions_to_protect ); @@ -906,6 +965,7 @@ function wp_set_internal_encoding() { if ( function_exists( 'mb_internal_encoding' ) ) { $charset = get_option( 'blog_charset' ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged if ( ! $charset || ! @mb_internal_encoding( $charset ) ) { mb_internal_encoding( 'UTF-8' ); } @@ -922,13 +982,6 @@ * @access private */ function wp_magic_quotes() { - // If already slashed, strip. - if ( get_magic_quotes_gpc() ) { - $_GET = stripslashes_deep( $_GET ); - $_POST = stripslashes_deep( $_POST ); - $_COOKIE = stripslashes_deep( $_COOKIE ); - } - // Escape with wpdb. $_GET = add_magic_quotes( $_GET ); $_POST = add_magic_quotes( $_POST ); @@ -966,7 +1019,7 @@ * @return object The cloned object. */ function wp_clone( $object ) { - // Use parens for clone to accommodate PHP 4. See #17880 + // Use parens for clone to accommodate PHP 4. See #17880. return clone( $object ); } @@ -982,7 +1035,7 @@ * * @since 1.5.1 * - * @global WP_Screen $current_screen + * @global WP_Screen $current_screen WordPress current screen object. * * @return bool True if inside WordPress administration interface, false otherwise. */ @@ -997,7 +1050,7 @@ } /** - * Whether the current request is for a site's admininstrative interface. + * Whether the current request is for a site's administrative interface. * * e.g. `/wp-admin/` * @@ -1006,7 +1059,7 @@ * * @since 3.1.0 * - * @global WP_Screen $current_screen + * @global WP_Screen $current_screen WordPress current screen object. * * @return bool True if inside WordPress blog administration pages. */ @@ -1028,9 +1081,12 @@ * Does not check if the user is an administrator; use current_user_can() * for checking roles and capabilities. * + * Does not check if the site is a Multisite network; use is_multisite() + * for checking if Multisite is enabled. + * * @since 3.1.0 * - * @global WP_Screen $current_screen + * @global WP_Screen $current_screen WordPress current screen object. * * @return bool True if inside WordPress network administration pages. */ @@ -1054,7 +1110,7 @@ * * @since 3.1.0 * - * @global WP_Screen $current_screen + * @global WP_Screen $current_screen WordPress current screen object. * * @return bool True if inside WordPress user administration pages. */ @@ -1135,9 +1191,7 @@ * @since 3.4.0 * @access private * - * @global WP_Locale $wp_locale The WordPress date and time locale object. - * - * @staticvar bool $loaded + * @global WP_Locale $wp_locale WordPress date and time locale object. */ function wp_load_translations_early() { global $wp_locale; @@ -1152,23 +1206,24 @@ return; } - // We need $wp_local_package + // We need $wp_local_package. require ABSPATH . WPINC . '/version.php'; - // Translation and localization + // Translation and localization. require_once ABSPATH . WPINC . '/pomo/mo.php'; require_once ABSPATH . WPINC . '/l10n.php'; require_once ABSPATH . WPINC . '/class-wp-locale.php'; require_once ABSPATH . WPINC . '/class-wp-locale-switcher.php'; - // General libraries + // General libraries. require_once ABSPATH . WPINC . '/plugin.php'; - $locales = $locations = array(); + $locales = array(); + $locations = array(); while ( true ) { if ( defined( 'WPLANG' ) ) { - if ( '' == WPLANG ) { + if ( '' === WPLANG ) { break; } $locales[] = WPLANG; @@ -1229,8 +1284,6 @@ * * @since 4.4.0 * - * @staticvar bool $installing - * * @param bool $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off. * Omit this parameter if you only want to fetch the current status. * @return bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will @@ -1263,7 +1316,7 @@ */ function is_ssl() { if ( isset( $_SERVER['HTTPS'] ) ) { - if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) { + if ( 'on' === strtolower( $_SERVER['HTTPS'] ) ) { return true; } @@ -1282,8 +1335,8 @@ * @since 2.3.0 * @since 4.6.0 Moved from media.php to load.php. * - * @link https://secure.php.net/manual/en/function.ini-get.php - * @link https://secure.php.net/manual/en/faq.using.php#faq.using.shorthandbytes + * @link https://www.php.net/manual/en/function.ini-get.php + * @link https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes * * @param string $value A (PHP ini) byte value, either shorthand or ordinary. * @return int An integer byte value. @@ -1309,9 +1362,7 @@ * * @since 4.6.0 * - * @staticvar array $ini_all - * - * @link https://secure.php.net/manual/en/function.ini-get-all.php + * @link https://www.php.net/manual/en/function.ini-get-all.php * * @param string $setting The name of the ini setting to check. * @return bool True if the value is changeable at runtime. False otherwise. @@ -1481,7 +1532,8 @@ * * @since 5.0.0 * - * @return bool True if Accepts or Content-Type headers contain application/json, false otherwise. + * @return bool True if `Accepts` or `Content-Type` headers contain `application/json`. + * False otherwise. */ function wp_is_json_request() { @@ -1530,7 +1582,8 @@ * * @since 5.2.0 * - * @return bool True if Accepts or Content-Type headers contain xml, false otherwise. + * @return bool True if `Accepts` or `Content-Type` headers contain `text/xml` + * or one of the related MIME types. False otherwise. */ function wp_is_xml_request() { $accepted = array(