diff options
author | Frank Karlitschek <frank@owncloud.org> | 2013-10-05 12:50:36 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2013-10-05 12:50:36 +0200 |
commit | 72b30e3e453bb6500278391861d52a084e96e988 (patch) | |
tree | 97847475b2627a2e4100074181f7f17b8cbdb5eb | |
parent | 485bb100b3993af46f6c6be66bd79c563dbffaed (diff) | |
download | nextcloud-server-72b30e3e453bb6500278391861d52a084e96e988.tar.gz nextcloud-server-72b30e3e453bb6500278391861d52a084e96e988.zip |
correctly expire cache if version file changed. Fixes problem that ownCloud only starts upgrading during login
-rwxr-xr-x | lib/private/util.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index ae9aef69b4c..1718ae6a041 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -182,9 +182,12 @@ class OC_Util { * @description load the version.php into the session as cache */ private static function loadVersion() { - if(!\OC::$server->getSession()->exists('OC_Version')) { + $timestamp=filemtime(OC::$SERVERROOT.'/version.php'); + if(!\OC::$server->getSession()->exists('OC_Version') or OC::$server->getSession()->get('OC_Version_Timestamp')<>$timestamp) { require 'version.php'; $session = \OC::$server->getSession(); + /** @var $timestamp int */ + $session->set('OC_Version_Timestamp', $timestamp); /** @var $OC_Version string */ $session->set('OC_Version', $OC_Version); /** @var $OC_VersionString string */ |