diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-06-27 13:08:16 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-06-27 13:08:16 +0200 |
commit | 420d23a875c19ba04d679db826bcf9bd2ad9d6c2 (patch) | |
tree | fb726f181e90eebfd58630be32bd806271559627 /lib | |
parent | 060a29726095e9b4ba838d2a28cae9a2e0e959a3 (diff) | |
download | nextcloud-server-420d23a875c19ba04d679db826bcf9bd2ad9d6c2.tar.gz nextcloud-server-420d23a875c19ba04d679db826bcf9bd2ad9d6c2.zip |
fix webdav errors for empty folders
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connector/sabre/directory.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index 9832449af3a..b75bb5c50f5 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -90,16 +90,18 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa foreach($folder_content as $info) { $paths[] = $this->path.'/'.$info['name']; } - $placeholders = join(',', array_fill(0, count($paths), '?')); - $query = OC_DB::prepare( 'SELECT * FROM *PREFIX*properties WHERE userid = ?' . ' AND propertypath IN ('.$placeholders.')' ); - array_unshift($paths, OC_User::getUser()); // prepend userid - $result = $query->execute( $paths ); $properties = array_fill_keys($paths, array()); - while($row = $result->fetchRow()) { - $propertypath = $row['propertypath']; - $propertyname = $row['propertyname']; - $propertyvalue = $row['propertyvalue']; - $properties[$propertypath][$propertyname] = $propertyvalue; + if(count($paths)>0){ + $placeholders = join(',', array_fill(0, count($paths), '?')); + $query = OC_DB::prepare( 'SELECT * FROM *PREFIX*properties WHERE userid = ?' . ' AND propertypath IN ('.$placeholders.')' ); + array_unshift($paths, OC_User::getUser()); // prepend userid + $result = $query->execute( $paths ); + while($row = $result->fetchRow()) { + $propertypath = $row['propertypath']; + $propertyname = $row['propertyname']; + $propertyvalue = $row['propertyvalue']; + $properties[$propertypath][$propertyname] = $propertyvalue; + } } $nodes = array(); |