From 0206a6811ff92d3bf95a18c333bd753a34326c44 Mon Sep 17 00:00:00 2001 From: interworks-morr Date: Fri, 2 Mar 2018 20:00:05 -0600 Subject: [PATCH] Improve cache reliability (#3421) Reported and fixed by @interworks-morr: "Occasionally with certain IIS setups, the file will contain an out-of-date class name. This patch will verify the class name from the file before returning, and clear the cache if invalid." --- modules/cms/classes/CodeParser.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/cms/classes/CodeParser.php b/modules/cms/classes/CodeParser.php index 651fc51fa..81b9bb13a 100644 --- a/modules/cms/classes/CodeParser.php +++ b/modules/cms/classes/CodeParser.php @@ -192,8 +192,10 @@ class CodeParser if (is_file($path)) { if ($className = $this->extractClassFromFile($path)) { - $data['className'] = $className; - return $data; + if (class_exists($className)) { + $data['className'] = $className; + return $data; + } } @unlink($path);