summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php6
1 files changed, 1 insertions, 5 deletions
diff --git a/include/functions.php b/include/functions.php
index 95d31b248..5e906a977 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -279,11 +279,7 @@
}
function with_trailing_slash(string $str) : string {
- if (substr($str, -1) === "/") {
- return $str;
- } else {
- return "$str/";
- }
+ return str_ends_with($str, '/') ? $str : "$str/";
}
function make_password(int $length = 12): string {