r92265 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92264‎ | r92265 | r92266 >
Date:18:20, 15 July 2011
Author:reedy
Status:deferred
Tags:
Comment:
MFT r90737, r90738 to 1.17wmf1, REL1_18
Modified paths:
  • /branches/REL1_18/extensions/TitleBlacklist/TitleBlacklist.hooks.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/TitleBlacklist/TitleBlacklist.hooks.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/TitleBlacklist/TitleBlacklist.hooks.php
@@ -15,6 +15,13 @@
1616 /** getUserPermissionsErrorsExpensive hook */
1717 public static function userCan( $title, $user, $action, &$result ) {
1818 global $wgTitleBlacklist;
 19+
 20+ # Some places check createpage, while others check create.
 21+ # As it stands, upload does createpage, but normalize both
 22+ # to the same action, to stop future similar bugs.
 23+ if( $action === 'createpage' || $action === 'createtalk' ) {
 24+ $action = 'create';
 25+ }
1926 if( $action == 'create' || $action == 'edit' || $action == 'upload' ) {
2027 efInitTitleBlacklist();
2128 $blacklisted = $wgTitleBlacklist->userCannot( $title, $user, $action );
Index: branches/REL1_18/extensions/TitleBlacklist/TitleBlacklist.hooks.php
@@ -25,6 +25,13 @@
2626 */
2727 public static function userCan( $title, $user, $action, &$result ) {
2828 global $wgTitleBlacklist;
 29+
 30+ # Some places check createpage, while others check create.
 31+ # As it stands, upload does createpage, but normalize both
 32+ # to the same action, to stop future similar bugs.
 33+ if( $action === 'createpage' || $action === 'createtalk' ) {
 34+ $action = 'create';
 35+ }
2936 if( $action == 'create' || $action == 'edit' || $action == 'upload' ) {
3037 efInitTitleBlacklist();
3138 $blacklisted = $wgTitleBlacklist->userCannot( $title, $user, $action );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90737(bug 28466) Make titleblack list consider 'createpage' action to be same as '...bawolff21:25, 24 June 2011
r90738follow-up r90737 - also normalize 'createtalk' for good measure....bawolff21:36, 24 June 2011

Status & tagging log