diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php index 22506f27cf684f2f1445a0b208a8a8f47ad09b14..f268f8b57c4b7a06d8b76e488db8e10b4fee0c93 100644 --- a/lib/connector/sabre/node.php +++ b/lib/connector/sabre/node.php @@ -233,7 +233,23 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * @param string $path Path of the file */ static public function removeETagPropertyForPath($path) { - $query = OC_DB::prepare( 'DELETE FROM *PREFIX*properties WHERE userid = ? AND propertypath = ? AND propertyname = ?' ); - $query->execute( array( OC_User::getUser(), $path, self::GETETAG_PROPERTYNAME )); + // remove tags from this and parent paths + $paths = array(); + while ($path != '/' && $path != '') { + $paths[] = $path; + $path = dirname($path); + } + if (empty($paths)) { + return; + } + $paths[] = $path; + $path_placeholders = join(',', array_fill(0, count($paths), '?')); + $query = OC_DB::prepare( 'DELETE FROM *PREFIX*properties' + .' WHERE userid = ?' + .' AND propertyname = ?' + .' AND propertypath IN ('.$path_placeholders.')' + ); + $vals = array( OC_User::getUser(), self::GETETAG_PROPERTYNAME ); + $query->execute(array_merge( $vals, $paths )); } } diff --git a/lib/filesystem.php b/lib/filesystem.php index 530d50139b488ec500f9ddb14abfe25ae22f68c1..47626c05ae28db6ac0bd821f8b1a85f76d4e739c 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -480,7 +480,6 @@ class OC_Filesystem{ $path=$params['oldpath']; } OC_Connector_Sabre_Node::removeETagPropertyForPath($path); - OC_Connector_Sabre_Node::removeETagPropertyForPath(dirname($path)); } } OC_Hook::connect('OC_Filesystem','post_write', 'OC_Filesystem','removeETagHook');