summaryrefslogtreecommitdiffstats
path: root/lib/connector/sabre/node.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connector/sabre/node.php')
-rw-r--r--lib/connector/sabre/node.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php
index 22506f27cf6..f268f8b57c4 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 ));
}
}