]> source.dussan.org Git - nextcloud-server.git/commitdiff
correctly expire cache if version file changed. Fixes problem that ownCloud only...
authorFrank Karlitschek <frank@owncloud.org>
Sat, 5 Oct 2013 10:50:36 +0000 (12:50 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Sat, 5 Oct 2013 10:50:36 +0000 (12:50 +0200)
lib/private/util.php

index ae9aef69b4cd1fce4efb6a85e4571cdf46042cb0..1718ae6a0413aeb8b3f9399933a22b3118e2c52e 100755 (executable)
@@ -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 */