Merge pull request #5142 from owncloud/fix_version_cache_expire
correctly expire cache if version file changed.
This commit is contained in:
commit
30faaf92b9
|
@ -182,9 +182,12 @@ class OC_Util {
|
||||||
* @description load the version.php into the session as cache
|
* @description load the version.php into the session as cache
|
||||||
*/
|
*/
|
||||||
private static function loadVersion() {
|
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';
|
require 'version.php';
|
||||||
$session = \OC::$server->getSession();
|
$session = \OC::$server->getSession();
|
||||||
|
/** @var $timestamp int */
|
||||||
|
$session->set('OC_Version_Timestamp', $timestamp);
|
||||||
/** @var $OC_Version string */
|
/** @var $OC_Version string */
|
||||||
$session->set('OC_Version', $OC_Version);
|
$session->set('OC_Version', $OC_Version);
|
||||||
/** @var $OC_VersionString string */
|
/** @var $OC_VersionString string */
|
||||||
|
|
Loading…
Reference in New Issue