diff options
| -rwxr-xr-x | LibertySystem.php | 11 | ||||
| -rw-r--r-- | admin/admin_liberty_inc.php | 9 |
2 files changed, 18 insertions, 2 deletions
diff --git a/LibertySystem.php b/LibertySystem.php index ae1c0cf..60e6c2a 100755 --- a/LibertySystem.php +++ b/LibertySystem.php @@ -3,7 +3,7 @@ * System class for handling the liberty package * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.71 2007/05/18 10:00:00 nickpalmer Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.72 2007/05/18 17:07:13 nickpalmer Exp $ * @author spider <spider@steelsun.com> */ @@ -186,7 +186,16 @@ class LibertySystem extends LibertyBase { } $gHtmlPurifier = new HTMLPurifier($config); + + // TODO: devise a way to parse plugins dir + // and check for the right property here + // so new plugins are just drop in place. + if ($gBitSystem->isFeatureActive('liberty_html_pure_allow_youtube')) { + require_once UTIL_PKG_PATH.'htmlpurifier/HTMLPurifier/Filter/YouTube.php'; + $gHtmlPurifier->addFilter(new HTMLPurifier_Filter_YouTube()); + } } + $pString = $gHtmlPurifier->purify($pString); /* There isn't an easy way to disable an attribute in HTMLPurifier */ diff --git a/admin/admin_liberty_inc.php b/admin/admin_liberty_inc.php index e1508cb..1eed7a5 100644 --- a/admin/admin_liberty_inc.php +++ b/admin/admin_liberty_inc.php @@ -76,8 +76,15 @@ $formLibertyHtmlPurifierFeatures = array( 'liberty_html_pure_xhtml' => array( 'label' => 'Force XHTML', 'note' => 'Determine if purification forces only XHTML tags or if it allows standard HTML.', + 'default' => 'y' + ), + // TODO: We should parse the plugins directory to generate these + // so that new plugins just have to be dropped in the dir and turned on. + 'liberty_html_pure_allow_youtube' => array( + 'label' => 'Allow YouTube', + 'note' => 'Allow YouTube videos to be passed through.', 'default' => 'n' - ) + ), ); $gBitSmarty->assign( 'formLibertyHtmlPurifierFeatures', $formLibertyHtmlPurifierFeatures ); |
