'bottrop', 'author'=>'L. Diener - lorenzd<at>gmail.com', 'url'=>'http://halcy.de/pages/bottrop', 'description'=>'Very simple spambot trap.', 'version'=>'1.0' ); # Set up hooks $wgHooks['ArticleSave'][] = array( 'spam_trap' ); $wgHooks['EditPage::showEditForm:fields'][] = 'add_spam_trap'; # Makes random strings. function random_string() { $chars = "abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_"; $i = mt_rand( 20, 50 ); $string = ""; while( $i > 0 ) { $string .= $chars{ mt_rand( 0, strlen( $chars ) ) }; $i--; } return $string; } # Spring the trap if something does not feel alright. # This only displays "edit conflict" errors, but meh. function spam_trap( &$article, &$user, &$text, &$summary, $minor, $watch, $sectionanchor, &$flags ) { global $bottrop_field_name, $bottrop_field_value; # Enforce setting changes to ensure effectiveness for at least a little while. if( $bottrop_field_name == "changeme" ) { return( "