https://bugzilla.wikimedia.org/show_bug.cgi?id=28245

           Summary: Title::getUserPermissionsErrors() does wierd things to
                    StubObjects
           Product: MediaWiki
           Version: 1.18-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: easy
          Severity: enhancement
          Priority: Normal
         Component: General/Unknown
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Should be very trivial to fix, but I a) am off to bed, and b) have a corrupted
working copy at the moment, so I'll post this here:

public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries =
true, $ignoreErrors = array() ) {
     if( !StubObject::isRealObject( $user ) ) {
     //Since StubObject is always used on globals, we can unstub $wgUser here
and set $user = $wgUser
    global $wgUser;
     $wgUser->_unstub( '', 5 );
     $user = $wgUser;
     }
...

This is wrong because it is testing for stub-ness on $user, but then
unconditionally unstubbing $wgUser, assuming that they must be the same.  Why
not just call $user->_unstub() ??  Needs investigating and patching.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to