summaryrefslogtreecommitdiff
path: root/admin/admin_liberty_inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/admin_liberty_inc.php')
-rw-r--r--admin/admin_liberty_inc.php55
1 files changed, 54 insertions, 1 deletions
diff --git a/admin/admin_liberty_inc.php b/admin/admin_liberty_inc.php
index 2fe7f56..efcc085 100644
--- a/admin/admin_liberty_inc.php
+++ b/admin/admin_liberty_inc.php
@@ -18,6 +18,50 @@ $formLibertyFeatures = array(
),
);
+$formLibertyHtmlPurifierFeatures = array(
+ 'liberty_html_pure_escape_bad' => array(
+ 'label' => 'Escape invalid HTML',
+ 'note' => ' Escapes invlid HTML as text. Otherwise invalid HTML is silently dropped. See <a href="http://htmlpurifier.org/live/configdoc/plain.html#Core.EscapeInvalidTags">this</a> and <a href="http://htmlpurifier.org/live/configdoc/plain.html#Core.EscapeInvalidChildren">this</a> for more information.',
+ 'default' => 'y'
+ ),
+ 'liberty_html_pure_disable_extern' => array(
+ 'label' => 'Disable External Links',
+ 'note' => 'Disables links to external websites which is effective against spam. See <a href="http://htmlpurifier.org/live/configdoc/plain.html#URI.DisableExternal">this</a> for more information.',
+ 'default' => 'n'
+ ),
+ 'liberty_html_pure_disable_extern_res' => array(
+ 'label' => 'Disable External Resounces',
+ 'note' => 'Disables the embedding of external resource like images from other hosts. See <a href="http://htmlpurifier.org/live/configdoc/plain.html#URI.DisableExternalResources">this</a> for more information.',
+ 'default' => 'y'
+ ),
+ 'liberty_html_pure_disable_res' => array(
+ 'label' => 'Disable All Resources',
+ 'note' => 'Disables the embedding of all resources preventing users from including pictures at all. See <a href="http://htmlpurifier.org/live/configdoc/plain.html#URI.DisableResources">this</a> for more information.',
+ 'default' => 'n'
+ ),
+ 'liberty_html_pure_disable_uri' => array(
+ 'label' => 'Disable all URIs',
+ 'note' => 'Disables all URIs in all forms within submitted content. See <a href="http://htmlpurifier.org/live/configdoc/plain.html#URI.Disable">this</a> for more information.',
+ 'default' => 'n'
+ ),
+ 'liberty_html_pure_use_redirect' => array(
+ 'label' => 'Use Redirect',
+ 'note' => 'Uses the redirect service in the Redirect URI. This can be handy to track clicks out and prevent leacks of PageRank. See <a href="http://htmlpurifier.org/live/configdoc/plain.html#URI.Munge">this</a> for more information.',
+ 'default' => 'n'
+ ),
+ 'liberty_html_pure_strict_html' => array(
+ 'label' => 'Force Strict',
+ 'note' => 'Determines if the purification matches the Transitional or Strict rule sets. See <a href="http://htmlpurifier.org/live/configdoc/plain.html#HTML.Strict">this</a> for more information.',
+ 'default' => 'y'
+ ),
+ 'liberty_html_pure_xhtml' => array(
+ 'label' => 'Force XHTML',
+ 'note' => 'Determine if purification forces only XHTML tags or if it allows standard HTML.',
+ 'default' => 'n'
+ )
+);
+$gBitSmarty->assign( 'formLibertyHtmlPurifierFeatures', $formLibertyHtmlPurifierFeatures );
+
$formLibertyTextareaFeatures = array(
"liberty_textarea_height" => array(
'label' => 'Default Textarea Height',
@@ -99,17 +143,26 @@ $formValues = array( 'image_processor', 'liberty_attachment_link_format', 'comme
if( !empty( $_REQUEST['change_prefs'] ) ) {
$errors = array();
- $formFeatures = array_merge( $formLibertyFeatures, $formImageFeatures, $formCaptcha );
+ $formFeatures = array_merge( $formLibertyFeatures, $formImageFeatures, $formCaptcha, $formLibertyHtmlPurifierFeatures );
foreach( $formFeatures as $item => $data ) {
simple_set_toggle( $item, LIBERTY_PKG_NAME );
}
foreach( $formLibertyTextareaFeatures as $item => $data ) {
simple_set_value( $item, LIBERTY_PKG_NAME );
}
+ simple_set_value('liberty_html_purifier', LIBERTY_PKG_NAME );
simple_set_value( 'liberty_attachment_style', LIBERTY_PKG_NAME );
$gBitSystem->storeConfig('liberty_cache', $_REQUEST['liberty_cache'], LIBERTY_PKG_NAME );
$gBitSystem->storeConfig('liberty_auto_display_attachment_thumbs', $_REQUEST['liberty_auto_display_attachment_thumbs'], LIBERTY_PKG_NAME );
+ if( !empty($_REQUEST['blacklisted_html_tags']) ) {
+ $tags = preg_replace( '/\s/', '', $_REQUEST['blacklisted_html_tags'] );
+ if (strlen( $tags ) > 250) {
+ $tags = substr( $tags, 0, 250 );
+ $errors['blacklist'] = 'The blacklisted tags list has been shortened. You can only have 250 characters for blacklisted tags.';
+ }
+ $gBitSystem->storeConfig('blacklisted_html_tags', $tags , LIBERTY_PKG_NAME );
+ }
if( $_REQUEST['approved_html_tags'] != DEFAULT_ACCEPTABLE_TAGS ) {
$tags = preg_replace( '/\s/', '', $_REQUEST['approved_html_tags'] );
$lastAngle = strrpos( $tags, '>' ) + 1;