From 752b3fb0e2a1027731c5e6ee655025a19075294c Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 28 Jun 2023 14:30:30 -0400 Subject: [PATCH] Fix route issue for manga pages --- app/appConf/routes.php | 5 +++-- src/AnimeClient/constants.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/appConf/routes.php b/app/appConf/routes.php index 85a3d5ca..2e3bc8e1 100644 --- a/app/appConf/routes.php +++ b/app/appConf/routes.php @@ -19,7 +19,8 @@ use const Aviat\AnimeClient\{ DEFAULT_CONTROLLER, DEFAULT_CONTROLLER_METHOD, NUM_PATTERN, - SLUG_PATTERN + SLUG_PATTERN, + SLUG_SPACE_PATTERN, }; // ------------------------------------------------------------------------- @@ -291,7 +292,7 @@ $routes = [ 'action' => 'edit', 'tokens' => [ 'id' => SLUG_PATTERN, - 'status' => '([a-zA-Z\-_]|%20)+', + 'status' => SLUG_SPACE_PATTERN, ], ], 'list' => [ diff --git a/src/AnimeClient/constants.php b/src/AnimeClient/constants.php index 07f6ddc9..f47f9a0f 100644 --- a/src/AnimeClient/constants.php +++ b/src/AnimeClient/constants.php @@ -28,6 +28,7 @@ const USER_AGENT = "Tim's Anime Client/5.2"; const ALPHA_SLUG_PATTERN = '[a-z_]+'; const NUM_PATTERN = '[0-9]+'; const SLUG_PATTERN = '[a-z0-9\-]+'; +const SLUG_SPACE_PATTERN = '[a-zA-Z_\- ]+'; // Why doesn't this already exist? const MILLI_FROM_NANO = 1000 * 1000;