From 1618b7318ecf9df792b38d58817dee47ba90bcaa Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 21 Mar 2015 14:09:35 +0100 Subject: [PATCH] Fixed handling of empty components causing to yield the wrong separator --- .../files/lib/system/request/FlexibleRoute.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php b/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php index d6d9bb90e9..b9397e1353 100644 --- a/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php +++ b/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php @@ -183,19 +183,22 @@ class FlexibleRoute implements IRoute { if ($useBuildSchema) { $lastSeparator = null; + $skipToLastSeparator = false; foreach ($this->buildSchema as $component) { $value = $component['value']; if ($component['type'] === 'separator') { $lastSeparator = $value; } - else { + else if ($skipToLastSeparator === false) { // routes are build from left-to-right if (empty($components[$value])) { + $skipToLastSeparator = true; + // drop empty components to avoid them being appended as query string argument unset($components[$value]); - break; + continue; } if ($lastSeparator !== null) { -- 2.20.1