0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-18 18:25:18 +00:00

[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
This commit is contained in:
Edward Z. Yang 2007-06-23 14:45:13 +00:00
parent 401612dc3a
commit 49bb6ec35d
2 changed files with 3 additions and 0 deletions

2
NEWS
View File

@ -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,

View File

@ -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