summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Palmer <nick@sluggardy.net>2007-06-07 00:36:02 +0000
committerNick Palmer <nick@sluggardy.net>2007-06-07 00:36:02 +0000
commit1732ef99fd1dcb3478b69a284b0a206d778ab2d1 (patch)
treea5a99b765dcb10d2b5fab98432c5de43f8ccf8c7
parent200bbf6445c4c1898331f1704fbf2b589891c802 (diff)
downloadliberty-1732ef99fd1dcb3478b69a284b0a206d778ab2d1.tar.gz
liberty-1732ef99fd1dcb3478b69a284b0a206d778ab2d1.tar.bz2
liberty-1732ef99fd1dcb3478b69a284b0a206d778ab2d1.zip
Fix double escape in comments. Add Force Allow HTML feature to deal with
wysiwyg editors better.
-rw-r--r--admin/plugins.php3
-rw-r--r--plugins/format.tikiwiki.php6
-rw-r--r--templates/admin_plugins.tpl10
-rw-r--r--templates/comments_post_inc.tpl2
-rw-r--r--templates/edit_format.tpl14
5 files changed, 23 insertions, 12 deletions
diff --git a/admin/plugins.php b/admin/plugins.php
index 4bf52ae..1c0937c 100644
--- a/admin/plugins.php
+++ b/admin/plugins.php
@@ -35,7 +35,8 @@ if( isset( $_REQUEST['pluginsave'] ) && !empty( $_REQUEST['pluginsave'] ) ) {
} else {
$gBitSmarty->assign( 'errorMsg', 'You cannot disable the default format');
}
- $gBitSystem->storeConfig( 'content_allow_html', !empty( $_REQUEST['content_allow_html'] ) ? $_REQUEST['content_allow_html'] : NULL );
+ $gBitSystem->storeConfig( 'content_force_allow_html', !empty( $_REQUEST['content_force_allow_html'] ) ? $_REQUEST['content_force_allow_html'] : NULL );
+ $gBitSystem->storeConfig( 'content_force_allow_html', !empty( $_REQUEST['content_force_allow_html'] ) ? $_REQUEST['content_force_allow_html'] : NULL );
}
diff --git a/plugins/format.tikiwiki.php b/plugins/format.tikiwiki.php
index c67f260..992ddd8 100644
--- a/plugins/format.tikiwiki.php
+++ b/plugins/format.tikiwiki.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Revision: 1.95 $
+ * @version $Revision: 1.96 $
* @package liberty
*/
global $gLibertySystem;
@@ -756,9 +756,9 @@ class TikiWikiParser extends BitBase {
}
// disable HTML in wiki page for now - very disruptive. should be changed into a per page setting - xing
- if( !empty( $contentPrefs['content_enter_html'] ) ) {
+ if( $gBitSystem->isFeatureActive('content_force_allow_html') || ($gBitSystem->isFeatureActive('content_allow_html') && !empty( $contentPrefs['content_enter_html'] ) ) ) {
$data = $gLibertySystem->purifyHtml($data);
- } elseif( !$gBitSystem->isFeatureActive( 'content_allow_html' ) ) {
+ } else {
// convert HTML to chars
$data = htmlspecialchars( $data, ENT_NOQUOTES, 'UTF-8' );
}
diff --git a/templates/admin_plugins.tpl b/templates/admin_plugins.tpl
index 6038a1e..8e7ca7c 100644
--- a/templates/admin_plugins.tpl
+++ b/templates/admin_plugins.tpl
@@ -61,7 +61,7 @@
<br />
{if $plugin_type eq 'format'}
- {formfeedback warning="{tr}This will change the way any wiki page that contains HTML will be displayed{/tr}"}
+ {formfeedback warning="{tr}This will change the way any wiki page that contains HTML will be displayed. We recommend turning on HTMLPurifier if either of these is on.{/tr}"}
<div class="row">
{formlabel label="Allow HTML" for="allow_html"}
{forminput}
@@ -70,6 +70,14 @@
{formhelp note="Allow the use of HTML in tikiwiki format content."}
{/forminput}
</div>
+ <div class="row">
+ {formlabel label="Force Allow HTML" for="force_allow_html"}
+ {forminput}
+ <input type="checkbox" name="content_force_allow_html" value="y" {if $gBitSystem->isFeatureActive('content_force_allow_html')}checked="checked"{/if} />
+ This will force HTML to be allowed for all users in tikiwiki format content. We recommend turning this on if you are using either WYSIWYG editor.
+ {formhelp note="This will force the allowance of HTML in tikiwiki format content for all users."}
+ {/forminput}
+ </div>
{/if}
{/legend}
{/jstab}
diff --git a/templates/comments_post_inc.tpl b/templates/comments_post_inc.tpl
index 872634f..0e8119e 100644
--- a/templates/comments_post_inc.tpl
+++ b/templates/comments_post_inc.tpl
@@ -38,7 +38,7 @@
</div>
{/if}
- {textarea id="commentpost" name="comment_data" rows=$gBitSystem->getConfig('comments_default_post_lines', 6)}{$postComment.data|escape}{/textarea}
+ {textarea id="commentpost" name="comment_data" rows=$gBitSystem->getConfig('comments_default_post_lines', 6)}{$postComment.data}{/textarea}
{captcha variant="row"}
<div class="row submit">
diff --git a/templates/edit_format.tpl b/templates/edit_format.tpl
index 2aa171b..a6ea40e 100644
--- a/templates/edit_format.tpl
+++ b/templates/edit_format.tpl
@@ -52,12 +52,14 @@
{if $plugin.plugin_guid == "tikiwiki"}
{assign var=format_options value=true}
&nbsp;&nbsp;
- {if $gBitUser->hasPermission( 'p_liberty_enter_html' )}
- <label><input type="checkbox" name="preferences[content_enter_html]" value="y" id="html" {if $gContent->mPrefs.content_enter_html}checked="checked" {/if}/> {tr}Allow HTML{/tr}</label>
- {elseif is_object($gContent) && $gContent->getPreference( 'content_enter_html' )}
- [ {tr}HTML will remain as HTML{/tr} ]
- {else}
- [ {tr}HTML will be escaped{/tr} ]
+ {if !$gBitSystem->isFeatureActive('content_force_allow_html')}
+ {if $gBitUser->hasPermission( 'p_liberty_enter_html' )}
+ <label><input type="checkbox" name="preferences[content_enter_html]" value="y" id="html" {if $gContent->mPrefs.content_enter_html}checked="checked" {/if}/> {tr}Allow HTML{/tr}</label>
+ {elseif is_object($gContent) && $gContent->getPreference( 'content_enter_html' )}
+ [ {tr}HTML will remain as HTML{/tr} ]
+ {else}
+ [ {tr}HTML will be escaped{/tr} ]
+ {/if}
{/if}
{/if}
{formhelp note=`$plugin.edit_help`}