Make WordPress Core

Ticket #12519: 12519.2.patch

File 12519.2.patch, 1.7 KB (added by hakre, 15 years ago)
  • wp-includes/load.php

     
    1212 * @since 2.1.0
    1313 * @return null Will return null if register_globals PHP directive was disabled
    1414 */
    15 function wp_unregister_GLOBALS() {
     15function wp_unregister_globals() {
    1616        if ( !ini_get( 'register_globals' ) )
    1717                return;
    1818
     
    2020                die( /*WP_I18N_GLOBALS_OVERWRITE*/'GLOBALS overwrite attempt detected'/*/WP_I18N_GLOBALS_OVERWRITE*/ );
    2121
    2222        // Variables that shouldn't be unset
    23         $noUnset = 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' );
    2424
    2525        $input = array_merge( $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset( $_SESSION ) && is_array( $_SESSION ) ? $_SESSION : array() );
    2626        foreach ( $input as $k => $v )
    27                 if ( !in_array( $k, $noUnset ) && isset( $GLOBALS[$k] ) ) {
    28                         $GLOBALS[$k] = NULL;
     27                if ( !in_array( $k, $no_unset ) && isset( $GLOBALS[$k] ) ) {
     28                        $GLOBALS[$k] = null;
    2929                        unset( $GLOBALS[$k] );
    3030                }
    3131}
  • wp-settings.php

     
    3232        date_default_timezone_set( 'UTC' );
    3333
    3434// Turn register_globals off.
    35 wp_unregister_GLOBALS();
     35wp_unregister_global();
    3636
    3737// Ensure these global variables do not exist so they do not interfere with WordPress.
    3838unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate );