From 2d8a380a21716f619bc38e769876dfa5752e6f68 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Wed, 27 Jun 2012 14:56:34 +0200 Subject: [PATCH 1/8] Fix recursion when running an update script --- lib/app.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/app.php b/lib/app.php index a9feff1620..61566ed752 100755 --- a/lib/app.php +++ b/lib/app.php @@ -36,6 +36,7 @@ class OC_App{ static private $appInfo = array(); static private $appTypes = array(); static private $loadedApps = array(); + static private $checkedApps = array(); /** * @brief loads all apps @@ -530,6 +531,10 @@ class OC_App{ * check if the app need updating and update when needed */ public static function checkUpgrade($app) { + if (in_array($app, self::$checkedApps)) { + return; + } + self::$checkedApps[] = $app; $versions = self::getAppVersions(); $currentVersion=OC_App::getAppVersion($app); if ($currentVersion) { From d5237c42bc0d6f9155629c15904b69b7f60e2e5f Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 27 Jun 2012 15:05:40 +0200 Subject: [PATCH 2/8] Util::formatDate() expect $timestamp as double --- apps/files_versions/ajax/getVersions.php | 4 +--- apps/files_versions/history.php | 4 ++-- apps/files_versions/js/versions.js | 4 ++-- apps/files_versions/templates/history.php | 4 +--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php index bee6054333..96289caec9 100644 --- a/apps/files_versions/ajax/getVersions.php +++ b/apps/files_versions/ajax/getVersions.php @@ -14,9 +14,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) { $versionsFormatted = array(); foreach ( $versions AS $version ) { - - $versionsFormatted[] = OCP\Util::formatDate( $version ); - + $versionsFormatted[] = OCP\Util::formatDate( doubleval($version) ); } $versionsSorted = array_reverse( $versions ); diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php index cb4726e8d0..ca03de0472 100644 --- a/apps/files_versions/history.php +++ b/apps/files_versions/history.php @@ -38,13 +38,13 @@ if ( isset( $_GET['path'] ) ) { $tmpl->assign( 'outcome_stat', 'success' ); - $tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) ); + $tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) ); } else { $tmpl->assign( 'outcome_stat', 'failure' ); - $tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) ); + $tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) ); } diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index 82d569fa0f..a090fde446 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -104,9 +104,9 @@ function createVersionsDropdown(filename, files) { } function addVersion(revision ) { - name=formatDate(revision*1000); + name=formatDate(revision.version*1000); var version=$('