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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.