r84575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84574‎ | r84575 | r84576 >
Date:22:30, 22 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r76344, fix another inversed logic

- if( !$item->userCan( $title, $wgUser, $action ) ) {
+ if( !$item->matches( $title, $action ) ) {

Fix some trailing whitespace also

Related to bug 27470 and bug 28166
Modified paths:
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.list.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php
@@ -28,7 +28,6 @@
2929 //Try to find something in the cache
3030 $cachedBlacklist = $wgMemc->get( wfMemcKey( "title_blacklist_entries" ) );
3131 if( is_array( $cachedBlacklist ) && count( $cachedBlacklist ) > 0 && ( $cachedBlacklist[0]->getFormatVersion() == self::VERSION ) ) {
32 -
3332 $this->mBlacklist = $cachedBlacklist;
3433 wfProfileOut( __METHOD__ );
3534 return;
@@ -147,7 +146,7 @@
148147 }
149148
150149 /**
151 - * Check whether the blacklist restricts
 150+ * Check whether the blacklist restricts
152151 * performing a specific action on the given Title
153152 *
154153 * @param $title Title to check
@@ -161,7 +160,7 @@
162161 }
163162 $blacklist = $this->getBlacklist();
164163 foreach ( $blacklist as $item ) {
165 - if( !$item->matches( $title, $action ) ) {
 164+ if( $item->matches( $title, $action ) ) {
166165 if( $this->isWhitelisted( $title, $action ) ) {
167166 return false;
168167 }
@@ -170,9 +169,9 @@
171170 }
172171 return false;
173172 }
174 -
 173+
175174 /**
176 - * Check whether it has been explicitly whitelisted that the
 175+ * Check whether it has been explicitly whitelisted that the
177176 * current User may perform a specific action on the given Title
178177 *
179178 * @param $title Title to check
@@ -191,7 +190,7 @@
192191 }
193192 return false;
194193 }
195 -
 194+
196195 /**
197196 * Get the current blacklist
198197 *
@@ -203,7 +202,7 @@
204203 }
205204 return $this->mBlacklist;
206205 }
207 -
 206+
208207 /*
209208 * Get the current whitelist
210209 *
@@ -215,7 +214,7 @@
216215 }
217216 return $this->mWhitelist;
218217 }
219 -
 218+
220219 /**
221220 * Get the text of a blacklist source via HTTP
222221 *
@@ -235,7 +234,7 @@
236235 }
237236 return $result;
238237 }
239 -
 238+
240239 /**
241240 * Invalidate the blacklist cache
242241 */
@@ -261,7 +260,7 @@
262261 }
263262 return $badEntries;
264263 }
265 -
 264+
266265 /**
267266 * Inidcates whether user can override blacklist on certain action.
268267 *

Follow-up revisions

RevisionCommit summaryAuthorDate
r84577* (bug 28166) UploadBase assumes that 'edit' and 'upload' rights are not per ...reedy22:36, 22 March 2011
r84581Followup r84575, bug 27470...reedy23:07, 22 March 2011
r846051.17wmf1: MFT r84573, r84575, r84579, r84581, r84602 (upload / blacklist fixes)catrope17:00, 23 March 2011
r85033MFT more extension revs: r82601, r82654, r82698, r82755, r82756, r82759, r829...demon18:49, 30 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76344Title blacklist:...vasilievvv21:55, 8 November 2010
r84573Followup r65898, fix inverse logic for title existence...reedy22:22, 22 March 2011

Status & tagging log