simon816/PHPDeobfuscator

fclose(): supplied resource is not a valid stream resource

JosefSommerauer opened this issue · 1 comments

Some files throw fclose(): supplied resource is not a valid stream resource Error.

Suggested fix:

fclose($handle->getResource());

     private function fclose(ResourceValue $handle)
     {
        if (is_resource($handle->getResource())) {
           fclose($handle->getResource());
        }
     }

Thanks for the bug report. I've fixed this in a slightly different way - by tracking whether a file handle has been closed and ignoring file handle functions once it's closed.