apply live hacks: debug logging for spam regex & blacklist hits
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 19 Jun 2008 23:33:45 +0000 (23:33 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 19 Jun 2008 23:33:45 +0000 (23:33 +0000)
includes/EditPage.php

index 1a9f4f7..d94ba49 100644 (file)
@@ -745,6 +745,10 @@ class EditPage {
                $matches = array();
                if ( $wgSpamRegex && preg_match( $wgSpamRegex, $this->textbox1, $matches ) ) {
                        $result['spam'] = $matches[0];
+                       $ip = wfGetIP();
+                       $pdbk = $this->mTitle->getPrefixedDBkey();
+                       $match = str_replace( "\n", '', $matches[0] );
+                       wfDebugLog( 'SpamRegex', "$ip spam regex hit [[$pdbk]]: \"$match\"" );
                        wfProfileOut( "$fname-checks" );
                        wfProfileOut( $fname );
                        return self::AS_SPAM_ERROR;