summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.php3
-rw-r--r--public/index.php4
2 files changed, 5 insertions, 2 deletions
diff --git a/app.php b/app.php
index 5e5e5e9..e436e42 100644
--- a/app.php
+++ b/app.php
@@ -6,7 +6,8 @@ $loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/views');
$twig = new \Twig\Environment($loader); # no cache
$function = new \Twig\TwigFunction('is_active', function($route) {
- if ( $_SERVER['REQUEST_URI'] == $route ) {
+ $url = strtok($_SERVER["REQUEST_URI"], '?');
+ if ( $url == $route ) {
echo " active ";
}
});
diff --git a/public/index.php b/public/index.php
index d8b9517..cbfba57 100644
--- a/public/index.php
+++ b/public/index.php
@@ -2,7 +2,9 @@
require_once __DIR__ . '/../app.php';
-switch( $_SERVER['REQUEST_URI'] ) {
+$url = strtok($_SERVER["REQUEST_URI"], '?');
+
+switch( $url ) {
case("/"):
echo $twig->render('index.html');