From 22cb18d47a4e01abcf3ea848e05adabc645ea80d Mon Sep 17 00:00:00 2001 From: HerrHase Date: Mon, 11 Oct 2021 16:14:10 +0200 Subject: [PATCH] adding #1 --- app/Repositories/PageRepository.php | 2 ++ public/index.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Repositories/PageRepository.php b/app/Repositories/PageRepository.php index 7d201fd..c736454 100644 --- a/app/Repositories/PageRepository.php +++ b/app/Repositories/PageRepository.php @@ -30,6 +30,8 @@ class PageRepository extends RepositoryAbstract // if slug not set, search for empty slug if (!$slug) { $slug = [ '_null' => 'true' ]; + } else { + $slug = [ '_eq' => $slug ]; } return $this->queryBuilder diff --git a/public/index.php b/public/index.php index 72c81ef..9b2d87d 100644 --- a/public/index.php +++ b/public/index.php @@ -5,6 +5,6 @@ require __DIR__.'/../app/bootstrap.php'; // default routes $flight->route('GET /404', array(new App\Controllers\PageController, 'notFoundAction')); -$flight->route('GET /(@slug:[a-zA-Z0-9_-])', array(new App\Controllers\PageController, 'getAction')); +$flight->route('GET /(@slug:[a-z0-9\-]+$)', array(new App\Controllers\PageController, 'getAction')); $flight->start();