diff options
| author | wjames5 <will@tekimaki.com> | 2009-05-27 21:01:55 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2009-05-27 21:01:55 +0000 |
| commit | f3353d8224a49747b7c91987b6a983570e5efcb3 (patch) | |
| tree | 261c2f49f1de949aeedcf905c1244850ea9f9c13 | |
| parent | 7c7635f0578ae302f9df20758c908bd689401711 (diff) | |
| download | liberty-f3353d8224a49747b7c91987b6a983570e5efcb3.tar.gz liberty-f3353d8224a49747b7c91987b6a983570e5efcb3.tar.bz2 liberty-f3353d8224a49747b7c91987b6a983570e5efcb3.zip | |
tidy up filters related to later versions and hanlde cnbc filter on legacy versions
| -rw-r--r-- | plugins/filter.htmlpurifier.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/filter.htmlpurifier.php b/plugins/filter.htmlpurifier.php index 861c2ae..736084f 100644 --- a/plugins/filter.htmlpurifier.php +++ b/plugins/filter.htmlpurifier.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_liberty/plugins/filter.htmlpurifier.php,v 1.26 2009/05/27 17:12:30 wjames5 Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/plugins/filter.htmlpurifier.php,v 1.27 2009/05/27 21:01:55 wjames5 Exp $ * @package liberty * @subpackage plugins_filter */ @@ -165,29 +165,28 @@ function htmlpure_getDefaultConfig( &$htmlp_version ){ // Set that we are using a div to wrap things. $config->set('HTML', 'BlockWrapper', 'div'); - // Disable included YouTube filter, we have our own - $config->set('Filter', 'YouTube', false); - // set plugins // TODO: devise a way to parse plugins dir // and check for the right property here // so new plugins are just drop in place. - $custom_filters = array(); if ( $htmlp_version >= 3.1 ){ + $custom_filters = array(); + + // Disable included YouTube filter, we have our own + $config->set('Filter', 'YouTube', false); + if ($gBitSystem->isFeatureActive('htmlpure_allow_youtube')) { require_once(UTIL_PKG_PATH.'htmlpure/Filter/YouTube.php'); - $custom_filters[] = new HTMLPurifier_Filter_YouTube(); } if ($gBitSystem->isFeatureActive('htmlpure_allow_cnbc')) { require_once(UTIL_PKG_PATH.'htmlpure/Filter/CNBC.php'); - $custom_filters[] = new HTMLPurifier_Filter_CNBC(); } - } - if( !empty( $custom_filters ) ){ - $config->set('Filter', 'Custom', $custom_filters ); + if( !empty( $custom_filters ) ){ + $config->set('Filter', 'Custom', $custom_filters ); + } } $blacklistedTags = $gBitSystem-> @@ -230,6 +229,10 @@ function htmlpure_legacyAddFilters(){ $gHtmlPurifier->addFilter(new HTMLPurifier_Filter_YouTube()); } + if ($gBitSystem->isFeatureActive('htmlpure_allow_cnbc')) { + require_once(UTIL_PKG_PATH.'htmlpure/Filter/CNBC.php'); + $gHtmlPurifier->addFilter(new HTMLPurifier_Filter_CNBC()); + } } function htmlpure_cleanupPeeTags( $pee ) { |
