diff options
author | Björn Schießle <schiessle@owncloud.com> | 2012-09-26 10:48:30 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2012-09-26 10:48:30 +0200 |
commit | c3c6e52104d7a3979b3a67069652e4d08e5b781e (patch) | |
tree | d4df5e4fed4e34a16b2d53fe4be1d9edb79b61c1 /apps | |
parent | 25499644e3ee38a8417b33b8817655ee1b0cf18d (diff) | |
download | nextcloud-server-c3c6e52104d7a3979b3a67069652e4d08e5b781e.tar.gz nextcloud-server-c3c6e52104d7a3979b3a67069652e4d08e5b781e.zip |
- take webdav namespace for properties into account
- change update routine to add the namesapce to all stored properties
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/appinfo/update.php | 20 | ||||
-rw-r--r-- | apps/files/appinfo/version | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 35008e345b9..d963b754772 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -1,14 +1,16 @@ <?php -// fix webdav properties, remove namespace information between curly bracket (update from OC4 to OC5) -$installedVersion=OCP\Config::getAppValue('files', 'installed_version'); -if (version_compare($installedVersion, '1.1.4', '<')) { - $query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" ); - $result = $query->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"] )); - } +// fix webdav properties,add namespace in front of the property, update for OC4.5
+$installedVersion=OCP\Config::getAppValue('files', 'installed_version');
+if (version_compare($installedVersion, '1.1.6', '<')) {
+ $query = OC_DB::prepare( "SELECT propertyname, propertypath, userid FROM `*PREFIX*properties`" );
+ $result = $query->execute();
+ while( $row = $result->fetchRow()){ + if ( $row["propertyname"][0] != '{' ) {
+ $query = OC_DB::prepare( 'UPDATE *PREFIX*properties SET propertyname = ? WHERE userid = ? AND propertypath = ?' );
+ $query->execute( array( '{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"] )); + }
+ }
} //update from OC 3 diff --git a/apps/files/appinfo/version b/apps/files/appinfo/version index e25d8d9f357..0664a8fd291 100644 --- a/apps/files/appinfo/version +++ b/apps/files/appinfo/version @@ -1 +1 @@ -1.1.5 +1.1.6 |