diff options
Diffstat (limited to 'inc/cache.php')
-rw-r--r-- | inc/cache.php | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/inc/cache.php b/inc/cache.php index c01e17c3e..9a9d5e3b0 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -217,24 +217,27 @@ class cache_renderer extends cache_parser { if (!parent::_useCache()) return false; - // for wiki pages, check metadata dependencies - if (isset($this->page)) { - $metadata = p_get_metadata($this->page); + if (!isset($this->page)) { + return true; + } - // check currnent link existence is consistent with cache version - // first check the purgefile - // - if the cache is more recent that the purgefile we know no links can have been updated - if ($this->_time < @filemtime($conf['cachedir'].'/purgefile')) { + // check current link existence is consistent with cache version + // first check the purgefile + // - if the cache is more recent than the purgefile we know no links can have been updated + if ($this->_time > @filemtime($conf['cachedir'].'/purgefile')) { + return true; + } -# $links = p_get_metadata($this->page,"relation references"); - $links = $metadata['relation']['references']; + // for wiki pages, check metadata dependencies + $metadata = p_get_metadata($this->page); - if (!empty($links)) { - foreach ($links as $id => $exists) { - if ($exists != page_exists($id,'',false)) return false; - } - } - } + if (!isset($metadata['relation']['references']) || + !empty($metadata['relation']['references'])) { + return true; + } + + foreach ($metadata['relation']['references'] as $id => $exists) { + if ($exists != page_exists($id,'',false)) return false; } return true; |