BlackList

Goal

I think it would be fair to say that this recipe has been superceded by PmWiki.Blocklist Prevent spammers from adding their !@*#% Links on my beautiful wiki.

This is http://www.pmwiki.org/wiki/Cookbook/BlackList with the "post" actions changed to "edit" to make it work for PmWiki 2.0. It works for me.

See also the Cookbook.Blocklist2 recipe which allows posts to be blocked based on words and IP addresses, as well as using (password-protected) wiki pages to maintain the block lists.

Solution

Attach:blacklist.zip

I am replacing the post-handle that takes care of the postings. I am checking the new entries for blacklistwords and if it is clear, I am calling the previously declared posthandler. If not, I am aborting.

Discussion

You might want to use Cookbook.Blocklist2 instead

Just include "blacklist.php" in your config.php file or somewhere else where it makes sense. If you call "blackListCheck($text)" it will return the number of banned words.

If you need further blackwords on the list, extend the $BlackList array with further strings. Currently the blacklist contains only links and words from an asian spammer that edited my pages during the last week quite a lot.

See Also

Update other functions that enable you to edit pages.

History

6.9.04: Converted from PmWiki 1.0 version.

6.9.04: Setting up this page

Comments & Bugs

Maybe it could be worthy to ban the IP that tried to add banned words (if a badwordcount is exceeded for example).

Contributors

  • Zet

superceded