1
run sql via phpmyadmin
UPDATE `xoops_config` SET `conf_formtype` = 'textarea', `conf_valuetype` = 'array' WHERE `conf_name` = 'censor_replace'
modife the file kenerl/config.php
about line 221
change
le="color: #000000"><?php if (is_array($configs)) { foreach (array_keys($configs) as $i) { $ret[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); } }
to
le="color: #000000"><?php if (is_array($configs)) { foreach (array_keys($configs) as $i) { if($configs[$i]->getVar('conf_name') == 'censor_words'){ $temp = array(); foreach($configs[$i]->getConfValueForOutput() as $j) $temp[] = "|$j|siU"; $ret[$configs[$i]->getVar('conf_name')] = $temp; } else { $ret[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); } } }
class/module.textsanitizer.php
about line 360
change function &censorString(&$text){....}
to
le="color: #000000"><?php function &censorString(&$text) { if (!isset($this->censorConf)) { $config_handler =& xoops_gethandler('config'); $this->censorConf =& $config_handler->getConfigsByCat(XOOPS_CONF_CENSOR); } if ($this->censorConf['censor_enable'] == 1) { $replacements = $this->censorConf['censor_replace']; $patterns = $this->censorConf['censor_words']; $text = preg_replace($patterns, $replacements, $text); } return $text; }
then u should enter the replace words also use the aaa|bbb format.