http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90737

Revision: 90737
Author:   bawolff
Date:     2011-06-24 21:25:50 +0000 (Fri, 24 Jun 2011)
Log Message:
-----------
(bug 28466) Make titleblack list consider 'createpage' action to be same as 
'create'.

In r65898, special:upload changed from checking create permission to checking 
createpage.
Titleblacklist hooks into the userCan create check to determine if the action 
is a new upload.
(aka not a reupload).

The create vs create(page|talk) permission thing is kind of confusing...

Modified Paths:
--------------
    trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php

Modified: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php
===================================================================
--- trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php    2011-06-24 
21:00:23 UTC (rev 90736)
+++ trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php    2011-06-24 
21:25:50 UTC (rev 90737)
@@ -25,6 +25,13 @@
         */
        public static function userCan( $title, $user, $action, &$result ) {
                global $wgTitleBlacklist;
+
+               # Some places check createpage, while others check create.
+               # As it stands, upload does createpage, but normalize both
+               # to the same action, to stop future similar bugs.
+               if( $action === 'createpage' ) {
+                       $action = 'create';
+               }
                if( $action == 'create' || $action == 'edit' || $action == 
'upload' ) {
                        efInitTitleBlacklist();
                        $blacklisted = $wgTitleBlacklist->userCannot( $title, 
$user, $action );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to