summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Palmer <nick@sluggardy.net>2007-05-18 17:07:16 +0000
committerNick Palmer <nick@sluggardy.net>2007-05-18 17:07:16 +0000
commitfdb7e5c97b83be86817774b6587df033c8285106 (patch)
tree7a82e330b1489286047956b668420bd9efdc8491
parent072c667fa8f05d6cc67f43b22c88374fe0691890 (diff)
downloadliberty-fdb7e5c97b83be86817774b6587df033c8285106.tar.gz
liberty-fdb7e5c97b83be86817774b6587df033c8285106.tar.bz2
liberty-fdb7e5c97b83be86817774b6587df033c8285106.zip
Add support for passing youtube video through HTMLPurifier.
-rwxr-xr-xLibertySystem.php11
-rw-r--r--admin/admin_liberty_inc.php9
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 );