From b374dbbfaa2ad1d94d87d5500bcec1c6f0ec56cc Mon Sep 17 00:00:00 2001 From: Nick Palmer Date: Fri, 18 May 2007 10:00:00 +0000 Subject: 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
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. --- LibertySystem.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'LibertySystem.php') 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 */ @@ -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; -- cgit v1.3