diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2022-05-04 14:18:41 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2022-05-04 14:18:41 +0000 |
| commit | 0d95625c2ab0eabe98e724ab79be0087093cc35b (patch) | |
| tree | f911e16bfb52f4aceacf9e9ad4c8d31923e26a6e /lib/functions.php | |
| parent | e1f835675363c17fbf5d269f6d1d1f84b6727886 (diff) | |
fix for BIESt #957
Merge request studip/studip!554
Diffstat (limited to 'lib/functions.php')
| -rw-r--r-- | lib/functions.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/functions.php b/lib/functions.php index 5d3d2bc..ae7307e 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1007,7 +1007,7 @@ function format_help_url($keyword) { // all help urls need short language tag (de, en) $lang = 'de'; - if ($_SESSION['_language']) { + if (!empty($_SESSION['_language'])) { [$lang] = explode('_', $_SESSION['_language']); } @@ -1429,10 +1429,11 @@ function get_route($route = '') $trails = explode('dispatch.php/', $route); $dispatcher = new StudipDispatcher(); $pieces = explode('/', $trails[1]); + $trail = ''; foreach ($pieces as $index => $piece) { $trail .= ($trail ? '/' : '') . $piece; if ($dispatcher->file_exists($trail . '.php')) { - $route = 'dispatch.php/' . $trail . ($pieces[$index+1] ? '/' . $pieces[$index+1] : ''); + $route = 'dispatch.php/' . $trail . (isset($pieces[$index+1]) ? '/' . $pieces[$index+1] : ''); } } } @@ -1461,7 +1462,7 @@ function match_route($requested_route, $current_route = '') return false; } // if no parameters given and base routes do match, return true - if (!$route_parts[1]) { + if (empty($route_parts[1])) { return true; } // extract vars and check if they are set accordingly |
