diff --git a/action.php b/action.php index fd6f150..fa88cba 100644 --- a/action.php +++ b/action.php @@ -204,6 +204,7 @@ function _doreplace(&$event, $param) { */ function _cache_control(&$event, $param) { global $conf; + global $ID; $cache =& $event->data; @@ -212,6 +213,15 @@ function _cache_control(&$event, $param) { $const = p_get_metadata($cache->page, 'plugin_const'); //force initial purge + if (is_string($const)) { + // something went wrong in the cache, fix the cache value + // and force invalidate for the time being + $const = array( + 'invalidate' => true + ); + + p_set_metadata($ID, array( 'plugin_const' => $const), false, true); + } if (!isset($const['invalidate'])) { $const['invalidate'] = true; }