From b2b57fd4391947448e018a14c0cbfe72147f4119 Mon Sep 17 00:00:00 2001 From: celestora Date: Tue, 11 Oct 2022 19:11:45 +0300 Subject: [PATCH] Fix scope pollution during presenter invocation --- chandler/MVC/Routing/Router.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chandler/MVC/Routing/Router.php b/chandler/MVC/Routing/Router.php index ce7f5b5..52d4fa8 100644 --- a/chandler/MVC/Routing/Router.php +++ b/chandler/MVC/Routing/Router.php @@ -153,7 +153,8 @@ class Router trigger_error("Could not open $tpl as template, falling back.", E_USER_NOTICE); $tpl = CHANDLER_EXTENSIONS_ENABLED . "/$namespace/Web/Presenters/templates/$presenterName/$action.xml"; } - + + //if(str_contains($presenterName, "Poll")) return json_encode($this->scope); $output = $this->delegateView($tpl, $presenter); $presenter->onAfterRender(); @@ -275,7 +276,8 @@ class Router function execute(string $url, ?string $parentModule = null): ?string { - $this->url = chandler_escape_url(parse_url($url, PHP_URL_PATH)); + $this->scope = []; + $this->url = chandler_escape_url(parse_url($url, PHP_URL_PATH)); if(!is_null($parentModule)) { $GLOBALS["parentModule"] = $parentModule;