Fixed bugs

This commit is contained in:
2026-06-19 16:40:37 +00:00
parent 0027766a77
commit 01fae418de
3 changed files with 9 additions and 9 deletions
@@ -49,7 +49,7 @@ class CustomizedValidatorVisitor extends NodeVisitorAbstract {
*/
public function leaveNode(Node $node){
if($node instanceof Node\Arg && $this->sandbox->sandbox_strings){
return new Node\Expr\FuncCall(new Node\Name\FullyQualified(($node->value instanceof Node\Expr\Variable) ? 'PHPSandbox\\wrapByRef' : 'PHPSandbox\\wrap'), [$node, new Node\Expr\StaticCall(new Node\Name\FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', [new Node\Arg(new Node\Scalar\String_($this->sandbox->name))])], $node->getAttributes());
return new Node\Expr\FuncCall(new Node\Name\FullyQualified(($node->value instanceof Node\Expr\Variable) ? 'PHPSandbox\\wrapByRef' : 'PHPSandbox\\wrap'), [$node, new Node\Expr\StaticCall(new Node\Name\FullyQualified("CloudObjects\\PhpMAE\\Sandbox\\CustomizedSandbox"), 'getGlobalSandbox')], $node->getAttributes());
} else if($node instanceof Node\Stmt\InlineHTML){
if(!$this->sandbox->allow_escaping){
$this->sandbox->validationError("Sandboxed code attempted to escape to HTML!", Error::ESCAPE_ERROR, $node);