Index: trunk/extensions/SpamRegex/SpecialSpamRegex.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * Protect against register_globals vulnerabilities. |
5 | 5 | * This line must be present before any global variable is referenced. |
6 | 6 | */ |
7 | | -if(!defined('MEDIAWIKI')) |
| 7 | +if( !defined( 'MEDIAWIKI' ) ) |
8 | 8 | die(); |
9 | 9 | |
10 | 10 | class SpamRegex extends SpecialPage { |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | * Constructor |
14 | 14 | */ |
15 | 15 | function __construct() { |
16 | | - parent::__construct( 'SpamRegex', 'spamregex', true, 'execute', false ); |
| 16 | + parent::__construct( 'SpamRegex', 'spamregex' ); |
17 | 17 | wfLoadExtensionMessages( 'SpamRegex' ); |
18 | 18 | } |
19 | 19 | |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $sRL->showSuccess(); |
51 | 51 | $sRF->showForm(''); |
52 | 52 | } else if ( 'failure_unblock' == $action ) { |
53 | | - $text = htmlspecialchars ($wgRequest->getVal( 'text' ) ); |
| 53 | + $text = htmlspecialchars( $wgRequest->getVal( 'text' ) ); |
54 | 54 | $sRF->showForm( wfMsg( 'spamregex-error-unblocking', $text ) ); |
55 | 55 | } else if ( $wgRequest->wasPosted() && 'submit' == $action && |
56 | 56 | $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { |
— | — | @@ -107,10 +107,10 @@ |
108 | 108 | |
109 | 109 | $wgOut->addWikiMsg( 'spamregex-currently-blocked' ); |
110 | 110 | /* get data and play with data */ |
111 | | - $dbr = wfGetDB( DB_SLAVE ); |
112 | 111 | if ( !$this->fetchNumResults() ) { |
113 | 112 | $wgOut->addWikiMsg( 'spamregex-no-currently-blocked' ); |
114 | 113 | } else { |
| 114 | + $dbr = wfGetDB( DB_SLAVE ); |
115 | 115 | $titleObj = SpecialPage::getTitleFor( 'SpamRegex' ); |
116 | 116 | $action = $titleObj->escapeLocalURL( self::getListBits() ); |
117 | 117 | $action_unblock = $titleObj->escapeLocalURL( 'action=delete&'.self::getListBits() ); |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | $key = wfSpamRegexCacheKey( 'spamRegexCore', 'numResults' ); |
178 | 178 | $cached = $wgMemc->get( $key ); |
179 | 179 | $results = 0; |
180 | | - if ( is_null( $cached ) ) { |
| 180 | + if ( is_null( $cached ) || $cached === false ) { |
181 | 181 | $dbr = wfGetDB( DB_SLAVE ); |
182 | 182 | $results = $dbr->selectField( 'spam_regex', 'COUNT(*)', '', __METHOD__ ); |
183 | 183 | $wgMemc->set( $key, $results, SPAMREGEX_EXPIRE ); |