Corveda / PHPSandbox

A PHP-based sandboxing library with a full suite of configuration and validation options.
https://phpsandbox.org
Other
220 stars 46 forks source link

Fix magic constants __DIR__ and file __FILE__ #17

Closed asabirov closed 5 years ago

asabirov commented 5 years ago

There was an issue when the code contains deep dependencies file1 includes file2 includes file3 etc. When the code uses __FILE__ or __DIR__, these constants must contain the current paths of the current directory or file. A simplest but workable solution is to replace __FILE__ and __DIR__ before eval-stage.