fix middleware args resolve conflict (#282)

This commit is contained in:
sunxyw
2023-02-08 17:23:44 +08:00
committed by GitHub
parent 5350bbb86d
commit 8f65e5a432
3 changed files with 19 additions and 7 deletions

View File

@@ -94,6 +94,9 @@ class MiddlewareHandler
}
}
if ($return !== false) {
// $args 传递数字索引可能会在部分情况下引发解析错误,应尽量避免
// 并尽量避免传递已经绑定入容器的实例
// TODO: 可能需要更好的解决方案
$result = container()->call($callback, $args);
}
while (isset($this->stack[$stack_id]) && ($item = array_pop($this->stack[$stack_id])) !== null) {