i don't think it quite works just yet.
seems to always return false!! i forgot to test it with a non bad word coment!
am fixing it
will keep you posted
sorry
Turning "ask question" on and off
Moderator: Thorsten
ok corrected functions which seems to work
function checkBannedWord($content)
{
$blockedWordsFile = 'blockedWords.txt';
// got original from from blocklist2 cookbook at pmwiki.org
require_once('local_changes/fileIterator.php');
// this include is from Richard Heyes (http://www.phpguru.org/)
$numBlocked=0;
if(!is_file($blockedWordsFile)){
// echo 'ERROR: Could not find blockedWordsFile file "'.$blockedWordsFile.'"';
exit;
} else {
foreach (new FileIterator($blockedWordsFile) as $badword) {
$badword = trim($badword); // get the word from the file
if (preg_match('/'.$badword.'/', $content)) {
$numBlocked++;
}
}
}
if ($numBlocked >0) {
return false;
//echo "NO SPAMMING ALLOWED2<P>";
} else {
//echo "OK good to go2<P>";
return true;
}
}
function checkBannedWord($content)
{
$blockedWordsFile = 'blockedWords.txt';
// got original from from blocklist2 cookbook at pmwiki.org
require_once('local_changes/fileIterator.php');
// this include is from Richard Heyes (http://www.phpguru.org/)
$numBlocked=0;
if(!is_file($blockedWordsFile)){
// echo 'ERROR: Could not find blockedWordsFile file "'.$blockedWordsFile.'"';
exit;
} else {
foreach (new FileIterator($blockedWordsFile) as $badword) {
$badword = trim($badword); // get the word from the file
if (preg_match('/'.$badword.'/', $content)) {
$numBlocked++;
}
}
}
if ($numBlocked >0) {
return false;
//echo "NO SPAMMING ALLOWED2<P>";
} else {
//echo "OK good to go2<P>";
return true;
}
}
Hi,
can you send me all your changes? I would add it into the next version of phpMyFAQ.
bye
Thorsten
can you send me all your changes? I would add it into the next version of phpMyFAQ.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist