From 938d9cce77ed5098dd69643795cb4014f3688b35 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 22 Dec 2015 10:20:27 +0100 Subject: Wallabag plugin improvement * Fixes a bug where URL weren't properly encoded. * Adds Wallabag V2 support. * Adds a URL function to handle trailing slash. * UT. * README updated. --- application/Url.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'application') diff --git a/application/Url.php b/application/Url.php index af43b457..d80c9c58 100644 --- a/application/Url.php +++ b/application/Url.php @@ -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 * -- cgit v1.2.3