12 if( version_compare( PHP_VERSION ,
'5.0.0' ) < 0 ) {
13 die(
'Turn postcommon_post_htmlpurify4guest.php off because this filter cannot run with PHP4' ) ;
16 if( is_object( $xoopsUser ) ) {
20 if( file_exists( XOOPS_ROOT_PATH.
'/class/icms.htmlpurifier.php' ) ) {
22 if( ! class_exists(
'icms_HTMLPurifier' ) ) {
23 require_once ICMS_ROOT_PATH.
'/class/icms.htmlpurifier.php' ;
27 $this->purifier =& icms_HTMLPurifier::getPurifierInstance() ;
28 $this->method =
'icms_html_purifier' ;
32 require_once dirname(dirname(__FILE__)).
'/library/HTMLPurifier.auto.php' ;
34 $config->set(
'Cache',
'SerializerPath', XOOPS_TRUST_PATH.
'/modules/protector/configs');
38 $this->method =
'purify' ;
47 if( is_array( $data ) ) {
48 return array_map( array( $this ,
'purify_recursive' ) , $data ) ;
50 return strlen( $data ) > 32 ? call_user_func( array( $this->purifier , $this->method ) , $data ) : $data ;