From 7739eae8d2d52578839eb771d7200a75dd582396 Mon Sep 17 00:00:00 2001
From: filippo.bertilotti <filippobertilotti@gmail.com>
Date: Tue, 14 May 2024 11:56:28 +0200
Subject: [PATCH] rimuovendo le credenziali del database e inizializzazione costruttore (parte 87)

---
 src/Framework/router.php |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/Framework/router.php b/src/Framework/router.php
index a6d804e..63596c4 100644
--- a/src/Framework/router.php
+++ b/src/Framework/router.php
@@ -12,15 +12,14 @@
 
 
     }
-    public function match (string $path,): array|bool {
-
+    public function match (string $path): array|bool {
+        $path = urldecode($path);
+        
         $path = trim($path, "/");   
 
         foreach ($this->routes as $route) {
 
             $pattern = $this->getPatternFromRoutePath($route["path"]);
-
-            echo $pattern, "\n";
 
             if(preg_match($pattern, $path, $matches)) {
                 $matches = array_filter($matches, "is_string", ARRAY_FILTER_USE_KEY);
@@ -50,6 +49,6 @@
             return $segment;
         }, $segments);
 
-        return "#^" . implode("/", $segments) . "$#";
+        return "#^" . implode("/", $segments) . "$#iu";
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0