summaryrefslogtreecommitdiffstats
path: root/apps/files/appinfo/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/appinfo/update.php')
-rw-r--r--apps/files/appinfo/update.php20
1 files changed, 11 insertions, 9 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