mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-30 19:00:10 +02:00
Fix two bugs with caching of customized raw definitions.
The first bug is that we will repeatedly write out the result of a customized raw definition to the filesystem, even when a cache entry already exists. The second bug is that caching these definitions doesn't actually work (the cache entry is written but never used.) A new API for retrieving raw definitions permits the user to take advantage of caching. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
@@ -12,6 +12,17 @@ abstract class HTMLPurifier_Definition
|
||||
*/
|
||||
public $setup = false;
|
||||
|
||||
/**
|
||||
* If true, write out the final definition object to the cache after
|
||||
* setup. This will be true only if all invocations to get a raw
|
||||
* definition object are also optimized. This does not cause file
|
||||
* system thrashing because on subsequent calls the cached object
|
||||
* is used and any writes to the raw definition object are short
|
||||
* circuited. See enduser-customize.html for the high-level
|
||||
* picture.
|
||||
*/
|
||||
public $optimized = null;
|
||||
|
||||
/**
|
||||
* What type of definition is it?
|
||||
*/
|
||||
|
Reference in New Issue
Block a user