From 5a66741bcc19a4819d3d34c49b9ee26cc48766e2 Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:57:16 +0300 Subject: [PATCH] we should check all routes until we find allowing route Signed-off-by: Alexander Piskun --- lib/Controller/ExAppProxyController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Controller/ExAppProxyController.php b/lib/Controller/ExAppProxyController.php index 23646f4d..1b48cd93 100644 --- a/lib/Controller/ExAppProxyController.php +++ b/lib/Controller/ExAppProxyController.php @@ -252,10 +252,11 @@ private function buildMultipartFormData(array $bodyParams, array $files): array private function passesExAppProxyRoutesChecks(ExApp $exApp, string $exAppRoute): bool { foreach ($exApp->getRoutes() as $route) { - $matchesUrlPattern = preg_match('/' . $route['url'] . '/i', $exAppRoute) === 1; - $matchesVerb = str_contains(strtolower($route['verb']), strtolower($this->request->getMethod())); - if ($matchesUrlPattern && $matchesVerb) { - return $this->passesExAppProxyRouteAccessLevelCheck($route['access_level']); + if (preg_match('/' . $route['url'] . '/i', $exAppRoute) === 1 && + str_contains(strtolower($route['verb']), strtolower($this->request->getMethod())) && + $this->passesExAppProxyRouteAccessLevelCheck($route['access_level']) + ) { + return true; } } return false;