Skip to content

Instantly share code, notes, and snippets.

@lisachenko
Last active December 14, 2015 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lisachenko/00fa92f811511f347e3a to your computer and use it in GitHub Desktop.
Save lisachenko/00fa92f811511f347e3a to your computer and use it in GitHub Desktop.
Bug with Optimizer+
<?php
class BugLoader extends php_user_filter
{
public function filter($in, $out, &$consumed, $closing)
{
eval("class Test extends ArrayObject {}");
return PSFS_PASS_ON;
}
}
function dynamicInclude()
{
return "php://filter/read=bug.test/resource=test.php";
}
echo "ArrayObject class ", class_exists('ArrayObject') ? 'exists' : 'not found';
stream_filter_register('bug.test', 'BugLoader');
include dynamicInclude();
Fatal error: Class 'ArrayObject' not found in C:\Work\go\demos\bug.php(31) : eval()'d code on line 1
<?php
// empty file here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment