]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/Url.php
Wallabag plugin improvement
[github/shaarli/Shaarli.git] / application / Url.php
old mode 100755 (executable)
new mode 100644 (file)
index af43b45..d80c9c5
@@ -51,6 +51,18 @@ function get_url_scheme($url)
   return $obj_url->getScheme();
 }
 
+/**
+ * Adds a trailing slash at the end of URL if necessary.
+ *
+ * @param string $url URL to check/edit.
+ *
+ * @return string $url URL with a end trailing slash.
+ */
+function add_trailing_slash($url)
+{
+    return $url . (!endsWith($url, '/') ? '/' : '');
+}
+
 /**
  * URL representation and cleanup utilities
  *