WordPress.org

Make WordPress Core

Ticket #12519: 12519.patch

File 12519.patch, 1.2 KB (added by hakre, 8 years ago)
  • 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}