10 if( version_compare( PHP_VERSION ,
'5.0.0' ) < 0 ) {
11 die(
'Turn postcommon_post_htmlpurify4everyone.php off because this filter cannot run with PHP4' ) ;
14 if( file_exists( XOOPS_ROOT_PATH.
'/class/icms.htmlpurifier.php' ) ) {
16 if( ! class_exists(
'icms_HTMLPurifier' ) ) {
17 require_once ICMS_ROOT_PATH.
'/class/icms.htmlpurifier.php' ;
21 $this->purifier =& icms_HTMLPurifier::getPurifierInstance() ;
22 $this->method =
'icms_html_purifier' ;
26 require_once dirname(dirname(__FILE__)).
'/library/HTMLPurifier.auto.php' ;
28 $config->set(
'Cache',
'SerializerPath', XOOPS_TRUST_PATH.
'/modules/protector/configs');
32 $this->method =
'purify' ;
41 if( is_array( $data ) ) {
42 return array_map( array( $this ,
'purify_recursive' ) , $data ) ;
44 return strlen( $data ) > 32 ? call_user_func( array( $this->purifier , $this->method ) , $data ) : $data ;