locale_xhtml('intro'); echo '
'; echo '
'; echo ''.$this->getLang('paste').''; echo '
'; echo ''; echo '
'; echo '
'; $found = array(); if($_REQUEST['whyspam']){ foreach($config_cascade['wordblock'] as $bla => $files){ foreach($files as $file){ $found = array_merge($found,$this->_checkit($file,$_REQUEST['whyspam'])); } } echo '
'; if(count($found)){ echo '

'.$this->getLang('found').'

'; echo ''; }else{ echo '

'.$this->getLang('notfound').'

'; } echo '
'; } } function _checkit($file,&$text){ $found = array(); $blockfile = (array) @file($file); $i=0; $text = preg_replace('!(\b)(www\.[\w.:?\-;,]+?\.[\w.:?\-;,]+?[\w/\#~:.?+=&%@\!\-.:?\-;,]+?)([.:?\-;,]*[^\w/\#~:.?+=&%@\!\-.:?\-;,])!i','\1http://\2 \2\3',$text); foreach($blockfile as $block){ $i++; $block = preg_replace('/#.*$/','',$block); $block = trim($block); if(empty($block)) continue; if(preg_match('#('.$block.')#si',$text,$matches)){ $pos = strpos($text,$matches[0]); $s = max(0,$pos - 15); $l = strlen($matches[0])+30; $snip = substr($text,$s,$l); $found[] = array($file, $i, $block, $snip); } } return $found; } } //Setup VIM: ex: et ts=4 :