Changeset 47122 for trunk/src/wp-includes/load.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/load.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r47088 r47122 36 36 } 37 37 38 // Variables that shouldn't be unset 38 // Variables that shouldn't be unset. 39 39 $no_unset = array( 'GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix' ); 40 40 … … 66 66 $_SERVER = array_merge( $default_server_values, $_SERVER ); 67 67 68 // Fix for IIS when running with PHP ISAPI 68 // Fix for IIS when running with PHP ISAPI. 69 69 if ( empty( $_SERVER['REQUEST_URI'] ) || ( PHP_SAPI != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { 70 70 71 71 if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) { 72 // IIS Mod-Rewrite 72 // IIS Mod-Rewrite. 73 73 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; 74 74 } elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) { 75 // IIS Isapi_Rewrite 75 // IIS Isapi_Rewrite. 76 76 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; 77 77 } else { 78 // Use ORIG_PATH_INFO if there is no PATH_INFO 78 // Use ORIG_PATH_INFO if there is no PATH_INFO. 79 79 if ( ! isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) ) { 80 80 $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; 81 81 } 82 82 83 // Some IIS + PHP configurations put s the script-name in the path-info (No need to append it twice)83 // Some IIS + PHP configurations put the script-name in the path-info (no need to append it twice). 84 84 if ( isset( $_SERVER['PATH_INFO'] ) ) { 85 85 if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) { … … 90 90 } 91 91 92 // Append the query string if it exists and isn't null 92 // Append the query string if it exists and isn't null. 93 93 if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { 94 94 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; … … 97 97 } 98 98 99 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests 99 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests. 100 100 if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) ) { 101 101 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; 102 102 } 103 103 104 // Fix for Dreamhost and other PHP as CGI hosts 104 // Fix for Dreamhost and other PHP as CGI hosts. 105 105 if ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false ) { 106 106 unset( $_SERVER['PATH_INFO'] ); 107 107 } 108 108 109 // Fix empty PHP_SELF 109 // Fix empty PHP_SELF. 110 110 $PHP_SELF = $_SERVER['PHP_SELF']; 111 111 if ( empty( $PHP_SELF ) ) { … … 472 472 'comment_karma' => '%d', 473 473 'comment_count' => '%d', 474 // multisite:474 // Multisite: 475 475 'active' => '%d', 476 476 'cat_id' => '%d', … … 550 550 } 551 551 552 // Re-initialize any hooks added manually by object-cache.php 552 // Re-initialize any hooks added manually by object-cache.php. 553 553 if ( $wp_filter ) { 554 554 $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter ); … … 667 667 $active_plugins = (array) get_option( 'active_plugins', array() ); 668 668 669 // Check for hacks file if the option is enabled 669 // Check for hacks file if the option is enabled. 670 670 if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { 671 671 _deprecated_file( 'my-hacks.php', '1.5.0' ); … … 680 680 681 681 foreach ( $active_plugins as $plugin ) { 682 if ( ! validate_file( $plugin ) // $plugin must validate as file683 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php'684 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 685 // not already included as a network plugin682 if ( ! validate_file( $plugin ) // $plugin must validate as file. 683 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php'. 684 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist. 685 // Not already included as a network plugin. 686 686 && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) ) 687 687 ) { … … 961 961 */ 962 962 function wp_clone( $object ) { 963 // Use parens for clone to accommodate PHP 4. See #17880 963 // Use parens for clone to accommodate PHP 4. See #17880. 964 964 return clone( $object ); 965 965 } … … 1150 1150 } 1151 1151 1152 // We need $wp_local_package 1152 // We need $wp_local_package. 1153 1153 require ABSPATH . WPINC . '/version.php'; 1154 1154 1155 // Translation and localization 1155 // Translation and localization. 1156 1156 require_once ABSPATH . WPINC . '/pomo/mo.php'; 1157 1157 require_once ABSPATH . WPINC . '/l10n.php'; … … 1159 1159 require_once ABSPATH . WPINC . '/class-wp-locale-switcher.php'; 1160 1160 1161 // General libraries 1161 // General libraries. 1162 1162 require_once ABSPATH . WPINC . '/plugin.php'; 1163 1163
Note: See TracChangeset
for help on using the changeset viewer.