From: Frank Karlitschek Date: Sat, 5 Oct 2013 10:50:36 +0000 (+0200) Subject: correctly expire cache if version file changed. Fixes problem that ownCloud only... X-Git-Tag: v6.0.0alpha2~76^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=72b30e3e453bb6500278391861d52a084e96e988;p=nextcloud-server.git correctly expire cache if version file changed. Fixes problem that ownCloud only starts upgrading during login --- 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 */