I've been testing the Wordpress (by making about 5 requests/s) CMS, but the problem is that Apache is constantly using 100% of the CPU. Lately I've had enough of that and I've traced down a problem to the wp_unregister_GLOBALS function that's located in the /wp-includes/load.php file and called from wp-settings.php.
The function is as follows:
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] );
}
}
I've tried commenting out the whole function body and commenting the function call in wp-settings.php, but the Apache was still using 100% of the CPU. THe only thing that helps is chaning the name of the function; then Apache is fine and everything is OK. But I would like to know why; I know that the function unregisters the GLOBAL variables, but why is it taking up 100% of the CPU. And why is it taking up 100% of the CPU when I've commented out the entire function's body and just returning null?
If anybody know the answer to the question, please let me know; otherwise it would be great to knowing whether I can change the name of the function for good: it's just for testing purposes only.