diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-24 23:39:40 +0000 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-24 23:39:40 +0000 |
commit | e18e659ca3b40ade283f51c91a263507d7c6694e (patch) | |
tree | e2852ba5c01d4125e802dd6fd5c66980b0b7d114 /plugins/OStatus | |
parent | 93507a192755494417eb0433edd315880752c857 (diff) |
Drop HTMLPurifier; we don't need its extra capabilities and we're already using htmLawed which is lighter-weight.
Diffstat (limited to 'plugins/OStatus')
-rw-r--r-- | plugins/OStatus/README | 4 | ||||
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 25 |
2 files changed, 3 insertions, 26 deletions
diff --git a/plugins/OStatus/README b/plugins/OStatus/README index 09a59e349..3a98b7b25 100644 --- a/plugins/OStatus/README +++ b/plugins/OStatus/README @@ -12,10 +12,6 @@ $config['ostatus']['hub_retries'] (default 0) Number of times to retry a PuSH send to consumers if using internal hub -$config['ostatus']['purify_cache'] - (default cache disabled) - Set to a writable cache directory for HTMLPurifier's configuration settings, can speed up processing of remote messages (have not tested by how much) - For testing, shouldn't be used in production: diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 33b0ceb9e..a366c1c2c 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -668,28 +668,9 @@ class Ostatus_profile extends Memcached_DataObject */ protected function purify($html) { - require_once(INSTALLDIR.'/extlib/HTMLPurifier/HTMLPurifier.auto.php'); - - // By default Purifier wants to cache data to its own code directories, - // and spews error messages if they're not writable. - $config = HTMLPurifier_Config::createDefault(); - if (common_config('ostatus', 'purify_cache')) { - $config->set('Cache.SerializerPath', common_config('ostatus', 'purify_cache')); - } else { - // Although recommended in the documentation, this produces a notice: - // "Core.DefinitionCache is an alias, preferred directive name is Cache.DefinitionImpl" - // If I then follow *those* directions, I get a warning and it doesn't work: - // "Cannot set undefined directive Core.DefinitionImpl" - // So... lesser of two evils. Suppressing the notice from output, - // though it'll still be seen and logged by StatusNet's error handler. - $old = error_reporting(); - error_reporting($old & ~E_NOTICE); - $config->set('Core.DefinitionCache', null); - error_reporting($old); - } - - $purifier = new HTMLPurifier($config); - return $purifier->purify($html); + require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php'; + $config = array('safe' => 1); + return htmLawed($html, $config); } /** |