Jump to content

function error??


darkfreaks

Recommended Posts

Fatal error: Maximum execution time of 30 seconds exceeded in /home/kabooc/public_html/func.lib.php on line 293

 

any help would be great ;D

 

<?php
   // Turn register globals off
  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]) ) {
             $GLOBALS[$k] = NULL;
             unset($GLOBALS[$k]); // line 293
       }
    }?>

Link to comment
https://forums.phpfreaks.com/topic/138686-function-error/
Share on other sites

I tried the code on my server and it didn't exceed execution time.  Theres 2 avenues I would investigate

 

1.  Is the function itself being called infinitely many times in a loop from somewhere else?

2.  Can you log to a file all the variables being unset (just before you unset them) and see if there's a specific one that causes it to loop?

Link to comment
https://forums.phpfreaks.com/topic/138686-function-error/#findComment-725095
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.