Skip to content

Commit

Permalink
Edge eval error cannot handle because $code not exists #986
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Sep 11, 2022
1 parent 8091d49 commit 224ac2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/edge/src/Edge.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ protected function getRenderFunction(array $data): Closure

if ($__path instanceof Closure) {
try {
eval(' ?>' . $code = $__edge->compile($__path($this, $__data)) . '<?php ');
eval(' ?>' . $__edge->compile($__path($this, $__data)) . '<?php ');
} catch (\Throwable $e) {
$__edge->wrapEvalException($e, $code, $__path);
$__edge->wrapEvalException($e, $__edge->compile($__path($this, $__data)), $__path);
}

return;
Expand All @@ -241,9 +241,9 @@ protected function getRenderFunction(array $data): Closure
include $__edge->getCache()->getCacheFile($__edge->getCache()->getCacheKey($__path));
} else {
try {
eval(' ?>' . $code = $__edge->getCache()->load($__path) . '<?php ');
eval(' ?>' . $__edge->getCache()->load($__path) . '<?php ');
} catch (\Throwable $e) {
$__edge->wrapEvalException($e, $code, $__path);
$__edge->wrapEvalException($e, $__edge->getCache()->load($__path), $__path);
}
}
};
Expand Down

0 comments on commit 224ac2c

Please sign in to comment.