aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/DAV/Client.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/Client.php')
-rw-r--r--vendor/sabre/dav/lib/DAV/Client.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Client.php b/vendor/sabre/dav/lib/DAV/Client.php
index d46b397b6..08d5d4702 100644
--- a/vendor/sabre/dav/lib/DAV/Client.php
+++ b/vendor/sabre/dav/lib/DAV/Client.php
@@ -3,6 +3,7 @@
namespace Sabre\DAV;
use Sabre\HTTP;
+use Sabre\Uri;
/**
* SabreDAV DAV client
@@ -387,20 +388,10 @@ class Client extends HTTP\Client {
*/
function getAbsoluteUrl($url) {
- // If the url starts with http:// or https://, the url is already absolute.
- if (preg_match('/^http(s?):\/\//', $url)) {
- return $url;
- }
-
- // If the url starts with a slash, we must calculate the url based off
- // the root of the base url.
- if (strpos($url, '/') === 0) {
- $parts = parse_url($this->baseUri);
- return $parts['scheme'] . '://' . $parts['host'] . (isset($parts['port']) ? ':' . $parts['port'] : '') . $url;
- }
-
- // Otherwise...
- return $this->baseUri . $url;
+ return Uri\resolve(
+ $this->baseUri,
+ $url
+ );
}