From 9d7fc98e1e0a96b59ecc1a7c39800a64445db364 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 9 Feb 2025 01:16:15 +0100 Subject: [PATCH] Fix if vocation name has more words --- system/pages/highscores.php | 2 +- system/routes.php | 8 ++++---- system/templates/highscores.html.twig | 10 ++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/system/pages/highscores.php b/system/pages/highscores.php index 269c8ce4..7290673e 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -23,7 +23,7 @@ if(config('account_country') && $settingHighscoresCountryBox) $list = $_GET['list'] ?? 'experience'; $page = $_GET['page'] ?? 1; -$vocation = $_GET['vocation'] ?? 'all'; +$vocation = urldecode($_GET['vocation'] ?? 'all'); if(!is_numeric($page) || $page < 1 || $page > PHP_INT_MAX) { $page = 1; diff --git a/system/routes.php b/system/routes.php index c49b16b1..13cee37f 100644 --- a/system/routes.php +++ b/system/routes.php @@ -39,10 +39,10 @@ return [ [['GET', 'POST'], 'guilds/{guild:string}', 'guilds/show.php'], - ['GET', 'highscores/{list:alphanum}/{vocation:alphanum}/{page:int}', 'highscores.php'], - ['GET', 'highscores/{list:alphanum}/{page:int}', 'highscores.php'], - ['GET', 'highscores/{list:alphanum}/{vocation:alphanum}', 'highscores.php'], - ['GET', 'highscores/{list:alphanum}', 'highscores.php'], + ['GET', 'highscores/{list:string}/{vocation:string}/{page:int}', 'highscores.php'], + ['GET', 'highscores/{list:string}/{page:int}', 'highscores.php'], + ['GET', 'highscores/{list:string}/{vocation:string}', 'highscores.php'], + ['GET', 'highscores/{list:string}', 'highscores.php'], /* '/^polls\/[0-9]+\/?$/' => array('subtopic' => 'polls', 'id' => '$1'), '/^spells\/[A-Za-z0-9-_%]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'spells', 'vocation' => '$1', 'order' => '$2'), diff --git a/system/templates/highscores.html.twig b/system/templates/highscores.html.twig index 938220e5..71d2d26c 100644 --- a/system/templates/highscores.html.twig +++ b/system/templates/highscores.html.twig @@ -9,9 +9,8 @@ @@ -19,9 +18,8 @@ @@ -105,7 +103,7 @@ {% for link, name in types %} - {{ name }}
+ {{ name }}
{% endfor %} @@ -120,7 +118,7 @@ [ALL]
{% for i in 0..config.vocations_amount %} - {{ config.vocations[i]}}
+ {{ config.vocations[i]}}
{% endfor %}