WebDAV::exists() should add a trailing slash for checking dirs

Without it, some WebDAV servers will thrown an error.
This commit is contained in:
Sean Harvey 2013-02-13 09:57:13 +13:00
parent a6fd64eacd
commit 871f2065c4
1 changed files with 6 additions and 1 deletions

View File

@ -13,6 +13,11 @@ class WebDAV {
}
static function exists($url) {
// WebDAV expects that checking a directory exists has a trailing slash
if (substr($url, -1) != '/') {
$url .= '/';
}
$ch = self::curl_init($url, 'PROPFIND');
$res = curl_exec($ch);
@ -60,4 +65,4 @@ class WebDAV {
}
}
}