If you try to create a directory in the root directory
(/phptojekt/webdav.php/ or whatever) the webdav addon
refuse to create the directory. This is not a problem
if the directory is created in an already existing
directory.
Webdav MKCOL requests on the first-level directory are
answered with a 409 status code (409 = Conflict).
According to RFC 2518 this error code if to be issued
when the client request that a directory be created
but the intermediate directories don't exist. For
example, if the client request /maindir/adir/bdir/ but
/maindir/adir/ don't exist, the server must answer with
a 409.
The function MKCOL in class_webdav.php calls function
_path_id to find out if the path of the collection
(directory) to be created already exist. If the
directory is / then it returns 0. The MKCOL function
just test the return value ($pid) for non-zero. So, the
condition doesn't disguise between a non-existant
directory and the root directory.
As a quick workaround, I changed the condition at lines
255 or so:
if (!$pid) {
return '409 Confilct';
}
I changed them to this:
if (!$pid) {
if ($pid !== 0) {
return '409 Confilct';
}
}
However, I hope the author can comment on this, maybe
I'm breaking something.
Mario A. Valdez-Ramírez.