summaryrefslogtreecommitdiff
path: root/LibertySystem.php
diff options
context:
space:
mode:
authorNick Palmer <nick@sluggardy.net>2007-05-18 10:00:00 +0000
committerNick Palmer <nick@sluggardy.net>2007-05-18 10:00:00 +0000
commitb374dbbfaa2ad1d94d87d5500bcec1c6f0ec56cc (patch)
treedfa93b5ad95801a8827e5f3eb1b4b8a15530c7b5 /LibertySystem.php
parentb8f9fd7ccefe05a22dedc6497d7563ecc78fb2bc (diff)
downloadliberty-b374dbbfaa2ad1d94d87d5500bcec1c6f0ec56cc.tar.gz
liberty-b374dbbfaa2ad1d94d87d5500bcec1c6f0ec56cc.tar.bz2
liberty-b374dbbfaa2ad1d94d87d5500bcec1c6f0ec56cc.zip
Move caching out of tikiwiki format and into LibertyContent so all formats
get cached, fixed caching bugs, added readCache and writeCache functions. Add 'cleanup' option to parseData to remove trailing <br /> tags and run the result through HMTMLPurifier. Add parseSplit call to handle split for descriptions and ensure that the result is cached properly. Need to update all contents to use parseSplit to generate descriptions in lists and previews instead of just truncating.
Diffstat (limited to 'LibertySystem.php')
-rwxr-xr-xLibertySystem.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/LibertySystem.php b/LibertySystem.php
index d13d430..ae1c0cf 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.70 2007/05/17 18:50:28 spiderr Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.71 2007/05/18 10:00:00 nickpalmer Exp $
* @author spider <spider@steelsun.com>
*/
@@ -115,15 +115,21 @@ class LibertySystem extends LibertyBase {
'simple' => "Simple Purifier");
}
- /**
- * Purify HTML from a string.
- *
- * @param string The string to be cleaned.
- * @returns string The sanitized string
+ /**
+ * Purify HTML from a string.
+ *
+ * @param string The string to be cleaned.
+ * @returns string The sanitized string
*/
- function purifyHtml($pString) {
+ function purifyHtml($pString, $pForceHTMLPurifier = false) {
global $gBitSystem;
- switch($gBitSystem->getConfig('liberty_html_purifier', 'simple')) {
+ if ($pForceHTMLPurifier) {
+ $purifier = 'htmlpurifier';
+ }
+ else {
+ $purifier = $gBitSystem->getConfig('liberty_html_purifier', 'simple');
+ }
+ switch ($purifier) {
case 'htmlpurifier':
$pString = $this->advancedPurifyHtml($pString);
break;