×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Maximum function nesting level of '100' reached

Maximum function nesting level of '100' reached 12 years 4 months ago #16474

  • Alain Rivest
  • Alain Rivest's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Hi Daniel,

I tested JEDchecker with my extensions. When I click unzip, it crashed with the error "PHP Fatal error: Maximum function nesting level of '100' reached, aborting!" With xdebug I found it's stucked in an infinite loop in unzipAll (uploads.php) because it call unzipAll back with the "." directory.

I fixed it with a call to isDot() to bypass the "." and ".." directories. I never used RecursiveDirectoryIterator before, so I'm not sure if my fix has any side effects...
    public function unzipAll($start)
    {
        $iterator = new RecursiveDirectoryIterator($start);
 
        foreach ($iterator as $file) {
            if ($file->isFile()) {
                $extension = $file->getExtension();
                if ($extension == 'zip') {
                    $unzip = $file->getPath() . '/' . $file->getBasename('.' . $extension);
                    $result = JArchive::extract($file->getPathname(), $unzip);
//                     delete the archive once we extract it
                    if ($result) {
                        JFile::delete($file->getPathname());
 
//                      now check the new extracted folder for archive files
                        $this->unzipAll($unzip);
                    }
                }
            } else if (!$iterator->isDot()) {
                $this->unzipAll($file->getPathname());
 
            }
        }
    }

Re: Maximum function nesting level of '100' reached 12 years 4 months ago #16488

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Alain,
Thank you very much for fixing the bug!
Can you perhaps send me the extension you tested it with to my e-mail address? I would like to confirm that you fix works.

Also maybe in the future you would like to use github.com/compojoom/jedchecker and send me a pull request :)

Cheers,
Daniel

Re: Maximum function nesting level of '100' reached 12 years 4 months ago #16493

  • Alain Rivest
  • Alain Rivest's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
I sent you an email with the extension. I never used Github before, but next time I'll give it a try!

And thanks for the JEDchecker, it's a very good idea! B)

Re: Maximum function nesting level of '100' reached 12 years 4 months ago #16494

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Thanks! I just tested it with the 1.0 version and the funny thing is it doesn't crash on me.

Are you on a linux machine?

Cheers,
Daniel

Re: Maximum function nesting level of '100' reached 12 years 4 months ago #16496

  • Alain Rivest
  • Alain Rivest's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Yes, I tested it on Kubuntu 11.10 with PHP 5.3.6 and Joomla 2.5.6.
I made another test on an other Joomla installation with the unmodified version of JEDchecker and I still get the error. Here is the full log :
 
  • Page:
  • 1
Time to create page: 0.123 seconds