diff --git a/NEWS b/NEWS index b84a19a7..a4c3d59c 100644 --- a/NEWS +++ b/NEWS @@ -11,7 +11,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier 2.1.0, unknown release date # flush-htmldefinition-cache.php superseded in favor of a generic - flush-definition-cache.php script + flush-definition-cache.php script, you can clear a specific cache + by passing its name as a parameter to the script ! Phorum mod implemented for HTML Purifier ! With %Core.AggressivelyFixLt, <3 and similar emoticons no longer trigger HTML removal in PHP5 (DOMLex). This directive is not necessary diff --git a/maintenance/flush-definition-cache.php b/maintenance/flush-definition-cache.php old mode 100644 new mode 100755 index 921a00c2..2b1567d1 --- a/maintenance/flush-definition-cache.php +++ b/maintenance/flush-definition-cache.php @@ -3,6 +3,8 @@ /** * Flushes the default HTMLDefinition serial cache + * @param Accepts one argument, cache type to flush; otherwise flushes all + * the caches. */ if (php_sapi_name() != 'cli') { @@ -16,8 +18,16 @@ require_once(dirname(__FILE__) . '/../library/HTMLPurifier.auto.php'); $config = HTMLPurifier_Config::createDefault(); -//$names = array('HTML', 'CSS', 'URI', 'Test'); -$names = array('URI'); +$names = array('HTML', 'CSS', 'URI', 'Test'); +if (isset($argv[1])) { + if (in_array($argv[1], $names)) { + $names = array($argv[1]); + } else { + echo "Did not recognized cache parameter {$argv[1]} as valid cache, aborting.\n"; + exit; + } +} + foreach ($names as $name) { echo " - Flushing $name\n"; $cache = new HTMLPurifier_DefinitionCache_Serializer($name); diff --git a/maintenance/generate-entity-file.php b/maintenance/generate-entity-file.php old mode 100644 new mode 100755 diff --git a/maintenance/merge-library.php b/maintenance/merge-library.php old mode 100644 new mode 100755 diff --git a/tests/index.php b/tests/index.php old mode 100644 new mode 100755