From 49bb6ec35d1fc3c2d7fb512c1fa49fbf2116013f Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sat, 23 Jun 2007 14:45:13 +0000 Subject: [PATCH] [2.0.1] DefinitionCache no longer throws errors when it encounters old serial files that do not conform to the current style git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1206 48356398-32a2-884e-a903-53898d9a118a --- NEWS | 2 ++ library/HTMLPurifier/DefinitionCache.php | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index feadcb10..f4cc74b1 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier - Configuration objects with different serials do not clobber each others when revision numbers are unequal - Improve Serializer DefinitionCache directory permissions checks +- DefinitionCache no longer throws errors when it encounters old + serial files that do not conform to the current style . Rewire some test-cases to swallow errors rather than expect them . HTMLDefinition printer updated with some of the new attributes . DefinitionCache keys reordered to reflect precedence: version number, diff --git a/library/HTMLPurifier/DefinitionCache.php b/library/HTMLPurifier/DefinitionCache.php index f21b0354..da18bff3 100644 --- a/library/HTMLPurifier/DefinitionCache.php +++ b/library/HTMLPurifier/DefinitionCache.php @@ -49,6 +49,7 @@ class HTMLPurifier_DefinitionCache * @param $config Instance of HTMLPurifier_Config to test against */ function isOld($key, $config) { + if (substr_count($key, '-') < 3) return true; list($version, $hash, $revision) = explode('-', $key, 3); $compare = version_compare($version, $config->version); // version mismatch, is always old