summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/lib/AddressHandler.php
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-11-02 10:44:55 +0100
committerBjoern Schiessle <bjoern@schiessle.org>2016-11-02 10:44:55 +0100
commit76b1dee499771c1b5327b4b7792e98fd41049096 (patch)
tree8a69cabd032979139c1ed8d6d95972b99fbfe4f7 /apps/federatedfilesharing/lib/AddressHandler.php
parent42b0a0d2afe95b974545436e112a1d97edaeeb1a (diff)
downloadnextcloud-server-76b1dee499771c1b5327b4b7792e98fd41049096.tar.gz
nextcloud-server-76b1dee499771c1b5327b4b7792e98fd41049096.zip
use https by default if no protocol is given. Only use unsecure connection if it is explicitely given
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/federatedfilesharing/lib/AddressHandler.php')
-rw-r--r--apps/federatedfilesharing/lib/AddressHandler.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/federatedfilesharing/lib/AddressHandler.php b/apps/federatedfilesharing/lib/AddressHandler.php
index 3c178b813e4..5fc41c2c804 100644
--- a/apps/federatedfilesharing/lib/AddressHandler.php
+++ b/apps/federatedfilesharing/lib/AddressHandler.php
@@ -161,6 +161,22 @@ class AddressHandler {
}
/**
+ * check if the url contain the protocol (http or https)
+ *
+ * @param string $url
+ * @return bool
+ */
+ public function urlContainProtocol($url) {
+ if (strpos($url, 'https://') === 0 ||
+ strpos($url, 'http://') === 0) {
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
* Strips away a potential file names and trailing slashes:
* - http://localhost
* - http://localhost/