From 98acc7323f43d2aa6d49fe0208f9d3bab51f6bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Goetz?= Date: Tue, 26 Nov 2019 22:08:18 +0100 Subject: [PATCH] Fix bug reported in #169 --- libs/DauxHelper.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/DauxHelper.php b/libs/DauxHelper.php index 845121c..a6a73cf 100644 --- a/libs/DauxHelper.php +++ b/libs/DauxHelper.php @@ -189,8 +189,6 @@ class DauxHelper continue; } - $node = DauxHelper::slug(urldecode($node)); - // if the node exists in the current request tree, // change the $tree variable to reference the new // node and proceed to the next url part @@ -199,6 +197,13 @@ class DauxHelper continue; } + // We try a second time by decoding the url + $node = DauxHelper::slug(urldecode($node)); + if (isset($tree->getEntries()[$node])) { + $tree = $tree->getEntries()[$node]; + continue; + } + // if the node doesn't exist, we can try // two variants of the requested file: // with and w/o the .html extension