Ticket #2153: php_self_patch_for_wp-settings.diff
| File php_self_patch_for_wp-settings.diff, 1.4 KB (added by , 20 years ago) |
|---|
-
trunk/wp-settings.php
18 18 19 19 unregister_GLOBALS(); 20 20 21 // On which page are we ? 22 $PHP_SELF = $_SERVER['PHP_SELF']; 23 if ( empty($PHP_SELF) ) 24 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); 25 21 26 $HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); 22 27 unset( $wp_filter, $cache_userdata, $cache_lastcommentmodified, $cache_lastpostdate, $cache_settings, $category_cache, $cache_categories ); 23 28 … … 118 123 119 124 $wpdb->hide_errors(); 120 125 $db_check = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'"); 121 if ( !$db_check && (!strstr($ _SERVER['PHP_SELF'], 'install.php') && !defined('WP_INSTALLING')) ) {122 if ( strstr($ _SERVER['PHP_SELF'], 'wp-admin') )126 if ( !$db_check && (!strstr($PHP_SELF, 'install.php') && !defined('WP_INSTALLING')) ) { 127 if ( strstr($PHP_SELF, 'wp-admin') ) 123 128 $link = 'install.php'; 124 129 else 125 130 $link = 'wp-admin/install.php'; … … 142 147 require (ABSPATH . WPINC . '/kses.php'); 143 148 require (ABSPATH . WPINC . '/version.php'); 144 149 145 if (!strstr($ _SERVER['PHP_SELF'], 'install.php')) :150 if (!strstr($PHP_SELF, 'install.php')) : 146 151 // Used to guarantee unique hash cookies 147 152 $cookiehash = md5(get_settings('siteurl')); // Remove in 1.4 148 153 define('COOKIEHASH', $cookiehash);