From 31adcf292cae6063dbf6686807f810f03505e063 Mon Sep 17 00:00:00 2001
From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de>
Date: Mon, 8 Aug 2022 11:38:09 +0000
Subject: [PATCH] fix handling of empty parts in get_route(), closes #1396

Closes #1396

Merge request studip/studip!851
---
 lib/functions.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/functions.php b/lib/functions.php
index a7f9f3a0b2f..9986104b50e 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1429,7 +1429,7 @@ function get_route($route = '')
         foreach ($pieces as $index => $piece) {
             $trail .= ($trail ? '/' : '') . $piece;
             if ($dispatcher->file_exists($trail . '.php')) {
-                $route = 'dispatch.php/' . $trail . (isset($pieces[$index+1]) ? '/' . $pieces[$index+1] : '');
+                $route = 'dispatch.php/' . $trail . (!empty($pieces[$index+1]) ? '/' . $pieces[$index+1] : '');
             }
         }
     }
-- 
GitLab