From: Alexander Ebert Date: Sat, 21 Mar 2015 13:09:35 +0000 (+0100) Subject: Fixed handling of empty components causing to yield the wrong separator X-Git-Tag: 2.1.2~21 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1618b7318ecf9df792b38d58817dee47ba90bcaa;p=GitHub%2FWoltLab%2FWCF.git Fixed handling of empty components causing to yield the wrong separator --- 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) {