diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-05 15:30:48 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-05 15:30:48 -0400 |
commit | 3d86add3dfa5e0b3ead9859593d4a52cf7555a34 (patch) | |
tree | 453d8bd3fda4dbb3020017ea1a469291da5cdc71 /extensions/SimpleAntiSpam/SimpleAntiSpam.php | |
parent | 064cec79ca4c8201de0d06bbca6cb7a5345d11be (diff) | |
parent | 2e44b49a2db3026050b136de9b00f749dd3ff939 (diff) |
Merge branch 'archwiki'
Diffstat (limited to 'extensions/SimpleAntiSpam/SimpleAntiSpam.php')
-rw-r--r-- | extensions/SimpleAntiSpam/SimpleAntiSpam.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/extensions/SimpleAntiSpam/SimpleAntiSpam.php b/extensions/SimpleAntiSpam/SimpleAntiSpam.php deleted file mode 100644 index 82fff7bc..00000000 --- a/extensions/SimpleAntiSpam/SimpleAntiSpam.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * SimpleSpam extension by Ryan Schmidt - * Adds a simple spam/bot check to forms - * Does not affect real users in any way/shape/form - */ - -if ( !defined( 'MEDIAWIKI' ) ) { - echo <<<EOM - This is an extension to the MediaWiki software and cannot be used standalone.\n - To install this on the wiki, add the following line to LocalSettings.php:\n - <tt>require_once( "\$IP/extensions/SimpleAntiSpam/SimpleAntiSpam.php" );</tt>\n - To verify the installation, browse to the Special:Version page on your wiki.\n -EOM; - die( 1 ); -} - -$wgExtensionCredits['antispam'][] = array( - 'path' => __FILE__, - 'name' => 'SimpleAntiSpam', - 'descriptionmsg' => 'simpleantispam-desc', - 'author' => 'Ryan Schmidt', - 'url' => 'https://www.mediawiki.org/wiki/Extension:SimpleAntiSpam', - 'version' => '1.1.0', -); - -$wgExtensionMessagesFiles['SimpleAntiSpam'] = __DIR__ . '/SimpleAntiSpam.i18n.php'; -$wgHooks['EditPage::showEditForm:fields'][] = 'efSimpleAntiSpamField'; -$wgHooks['EditPage::attemptSave'][] = 'efSimpleAntiSpamCheck'; - -/** - * Add the form field - * @param $editpage EditPage - * @param $out OutputPage - * @return bool - */ -function efSimpleAntiSpamField( &$editpage, &$out ) { - $out->addHTML( "<div id=\"antispam-container\" style=\"display: none;\"> -<label for=\"wpAntispam\">" - . wfMessage( 'simpleantispam-label' )->parse() - . "</label> <input type=\"text\" name=\"wpAntispam\" id=\"wpAntispam\" value=\"\" /> -</div>\n" ); - return true; -} - -/** - * Check for the field and if it isn't empty, negate the save - * - * @param $editpage EditPage - * @return bool - */ -function efSimpleAntiSpamCheck( $editpage ) { - global $wgRequest, $wgUser; - $spam = $wgRequest->getText( 'wpAntispam' ); - if ( $spam !== '' ) { - wfDebugLog( - 'SimpleAntiSpam', - $wgUser->getName() . - ' editing "' . - $editpage->mTitle->getPrefixedText() . - '" submitted bogus field "' . - $spam . - '"' - ); - $editpage->spamPageWithContent(); - return false; - } - return true; -} |