BlackList

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Goal

Prevent spammers from adding their !@*#% Links on my beautyfull wiki.

Solution

Download Zipfile (I would like to use this file - do not have password. please send to webmaster:societyofcontrol.com - thanks!!)

I am replacing the edit-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

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: 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).

Hello. I replaced the "post" action with "edit" and added it to the pmwiki2 site, at| Cookbook/BlackList. I hope you don't mind. I needed it to try to stop a mat chinese spammer on my side. I'll try to update the 2.0 version when needed.

Contributors

  • Zet

pmwiki-2.5.9 -- Last modified by {{}}

from IP: 85.171.160.186 ip should be disabled by default for security reasons

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=Cookbook%2dV1%2fBlackList
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=Cookbook%2dV1%2fBlackList
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook-V1/BlackList
            [REDIRECT_SCRIPT_URL] => /wiki/Cookbook-V1/BlackList
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afJmU0AYvDgiqfmhdAzWjgAAAQc
            [REDIRECT_URL] => /wiki/Cookbook-V1/BlackList
            [REMOTE_ADDR] => 216.73.216.31
            [REMOTE_PORT] => 24315
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/Cookbook-V1/BlackList
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook-V1/BlackList
            [SCRIPT_URL] => /wiki/Cookbook-V1/BlackList
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afJmU0AYvDgiqfmhdAzWjgAAAQc
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777493588.0192
            [REQUEST_TIME] => 1777493588
            [argv] => Array
                (
                    [0] => n=Cookbook%2dV1%2fBlackList
                )

            [argc] => 1
        )

)