aboutsummaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-11-24 14:06:57 +0000
committerAndrew Dolgov <fox@fakecake.org>2024-11-24 14:06:57 +0000
commit103bafd90a33abc1478e7c4ec6b732ebd04a4995 (patch)
treef28c7ece3584a7852b6562020246b1de6167774e /include/functions.php
parent53fee911e6a39a5c8504d03d1f114a131d00784c (diff)
parent667528d5b927f0f284a067b0e24c9ca7f26c28a4 (diff)
Merge branch 'feature/php8-str-funcs' into 'master'
Use PHP 8 'str_' functions. See merge request tt-rss/tt-rss!81
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 {