diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 8 | ||||
-rwxr-xr-x | include/login_form.php | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/functions.php b/include/functions.php index 5e75439cf..73d963803 100644 --- a/include/functions.php +++ b/include/functions.php @@ -236,6 +236,14 @@ } } + function with_trailing_slash(string $str) : string { + if (substr($str, -1) === "/") { + return $str; + } else { + return "$str/"; + } + } + function make_password($length = 12) { $password = ""; $possible = "0123456789abcdfghjkmnpqrstvwxyzABCDFGHJKMNPQRSTVWXYZ*%+^"; diff --git a/include/login_form.php b/include/login_form.php index 91850b768..be6734d07 100755 --- a/include/login_form.php +++ b/include/login_form.php @@ -85,7 +85,7 @@ </script> -<?php $return = urlencode(Config::make_self_url()) ?> +<?php $return = urlencode($_REQUEST['return'] ? $_REQUEST['return'] : with_trailing_slash(Config::make_self_url())) ?> <div class="container"> |