From bd63fddbf44312f7c388711b6f7b990245654283 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 23 Jul 2012 10:34:01 +0200 Subject: [PATCH] fix broken properties in the database --- apps/files/appinfo/update.php | 4 ++-- lib/connector/sabre/node.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 88db08e7e2..5514aed197 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -1,13 +1,13 @@ execute(); while( $row = $result->fetchRow()){ $query = OC_DB::prepare( 'UPDATE *PREFIX*properties SET propertyname = ? WHERE userid = ? AND propertypath = ?' ); - $query->execute( array( preg_replace("/{.*}/", "", $row["propertyname"]),$row["userid"], $row["propertypath"] )); + $query->execute( array( preg_replace("/^{.*}/", "", $row["propertyname"]),$row["userid"], $row["propertypath"] )); } } diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php index a70a1e0721..663970487f 100644 --- a/lib/connector/sabre/node.php +++ b/lib/connector/sabre/node.php @@ -142,7 +142,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr public function updateProperties($properties) { $existing = $this->getProperties(array()); foreach($properties as $propertyName => $propertyValue) { - $propertyName = preg_replace("/^{.*}/", "", $propertyName); // fix broken property name + $propertyName = preg_replace("/^{.*}/", "", $propertyName); // remove leading namespace from property name // If it was null, we need to delete the property if (is_null($propertyValue)) { if(array_key_exists( $propertyName, $existing )){