Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_unregister_globals [ WordPress Function ]

wp_unregister_globals ( No parameters )
Access:
  • private
Returns:
  • (null) Will return null if register_globals PHP directive was disabled
Defined at:



Turn register globals off.

Source


<?php
function wp_unregister_GLOBALS() {
    if ( !
ini_get'register_globals' ) )
        return;

    if ( isset( 
$_REQUEST['GLOBALS'] ) )
        die( 
'GLOBALS overwrite attempt detected' );

    
// Variables that shouldn't be unset
    
$no_unset = array( 'GLOBALS''_GET''_POST''_COOKIE''_REQUEST''_SERVER''_ENV''_FILES''table_prefix' );

    
$input array_merge$_GET$_POST$_COOKIE$_SERVER$_ENV$_FILES, isset( $_SESSION ) && is_array$_SESSION ) ? $_SESSION : array() );
    foreach ( 
$input as $k => $v )
        if ( !
in_array$k$no_unset ) && isset( $GLOBALS[$k] ) ) {
            
$GLOBALS[$k] = null;
            unset( 
$GLOBALS[$k] );
        }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics