Ticket #12519: 12519.patch
File 12519.patch, 1.2 KB (added by , 15 years ago) |
---|
-
load.php
12 12 * @since 2.1.0 13 13 * @return null Will return null if register_globals PHP directive was disabled 14 14 */ 15 function wp_unregister_ GLOBALS() {15 function wp_unregister_globals() { 16 16 if ( !ini_get( 'register_globals' ) ) 17 17 return; 18 18 … … 20 20 die( /*WP_I18N_GLOBALS_OVERWRITE*/'GLOBALS overwrite attempt detected'/*/WP_I18N_GLOBALS_OVERWRITE*/ ); 21 21 22 22 // Variables that shouldn't be unset 23 $no Unset = array( 'GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix' );23 $no_unset = array( 'GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix' ); 24 24 25 25 $input = array_merge( $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset( $_SESSION ) && is_array( $_SESSION ) ? $_SESSION : array() ); 26 26 foreach ( $input as $k => $v ) 27 if ( !in_array( $k, $no Unset ) && isset( $GLOBALS[$k] ) ) {28 $GLOBALS[$k] = NULL;27 if ( !in_array( $k, $no_unset ) && isset( $GLOBALS[$k] ) ) { 28 $GLOBALS[$k] = null; 29 29 unset( $GLOBALS[$k] ); 30 30 } 31 31 }