Vous souhaitez partager une portion de code sur votre blog ?
[code lang= »PHP »]function unregister_GLOBALS() {
if ( !ini_get(‘register_globals’) )
return;
if ( isset($_REQUEST[‘GLOBALS’]) )
die(‘GLOBALS overwrite attempt detected’);
// Variables that shouldn’t be unset
$noUnset = 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, $noUnset) && isset($GLOBALS[$k]) )
unset($GLOBALS[$k]);
}
[/code]
2ème exemple ^^
[code lang= »javascript »]function hello(){ alert(« hello, je m’appelle Yan et je découvre WordPress ! »);}[/code]
Pour arriver à ce resultat… Un simple plugin… Code Snippet
Et le tour est joué !
5 Commentaires
Répondre →