summaryrefslogtreecommitdiffstats
path: root/lib/private/util.php
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2013-10-07 03:48:29 -0700
committerFrank Karlitschek <frank@owncloud.org>2013-10-07 03:48:29 -0700
commit30faaf92b9a427594a061420c590daf6dd372013 (patch)
tree533a880b2abee1b4fe24313d38ece84a7f8c03b9 /lib/private/util.php
parent1e47468c53964591905760c2f7fad14725bdb1de (diff)
parent3f29e4ebeab9fee22ca16656388080e3be92cc12 (diff)
downloadnextcloud-server-30faaf92b9a427594a061420c590daf6dd372013.tar.gz
nextcloud-server-30faaf92b9a427594a061420c590daf6dd372013.zip
Merge pull request #5142 from owncloud/fix_version_cache_expire
correctly expire cache if version file changed.
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-xlib/private/util.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index c5b4d2ae93e..6c0a8d7bab5 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 */