diff options
Diffstat (limited to 'apps/files_sharing/lib/helper.php')
-rw-r--r-- | apps/files_sharing/lib/helper.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/helper.php index 05b0352ca1f..c76704802b1 100644 --- a/apps/files_sharing/lib/helper.php +++ b/apps/files_sharing/lib/helper.php @@ -306,4 +306,20 @@ class Helper { \OC::$server->getConfig()->setSystemValue('share_folder', $shareFolder); } + /** + * remove protocol from URL + * + * @param string $url + * @return string + */ + public static function removeProtocolFromUrl($url) { + if (strpos($url, 'https://') === 0) { + return substr($url, strlen('https://')); + } else if (strpos($url, 'http://') === 0) { + return substr($url, strlen('http://')); + } + + return $url; + } + } |