Index: branches/wmf/1.17wmf1/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -15,6 +15,13 @@ |
16 | 16 | /** getUserPermissionsErrorsExpensive hook */ |
17 | 17 | public static function userCan( $title, $user, $action, &$result ) { |
18 | 18 | 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 | + } |
19 | 26 | if( $action == 'create' || $action == 'edit' || $action == 'upload' ) { |
20 | 27 | efInitTitleBlacklist(); |
21 | 28 | $blacklisted = $wgTitleBlacklist->userCannot( $title, $user, $action ); |
Index: branches/REL1_18/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -25,6 +25,13 @@ |
26 | 26 | */ |
27 | 27 | public static function userCan( $title, $user, $action, &$result ) { |
28 | 28 | 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 | + } |
29 | 36 | if( $action == 'create' || $action == 'edit' || $action == 'upload' ) { |
30 | 37 | efInitTitleBlacklist(); |
31 | 38 | $blacklisted = $wgTitleBlacklist->userCannot( $title, $user, $action ); |