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

--- Comment #8 from Reedy <[email protected]> 2011-03-14 23:06:11 UTC ---
Ok, had to hack the core to get it to through me that error (the check for
$user->isAllowed( 'reupload-shared' )

The issue seems to be the way

$code = array_shift( $permErrors[0] );
$this->showRecoverableUploadError( wfMsgExt( $code,
      'parseinline', $permErrors[0] ) );

is working

We're only currently returning a string, not the file name. I see the same
issue for 'fileexists-forbidden' in the same checkOverwrite method.

The fix I can see is changing it

from
return 'fileexists-shared-forbidden';

to

return array( 'fileexists-shared-forbidden', $file->getName() );

Which then gets double array wrapped by verifyPermissions

        $overwriteError = $this->checkOverwrite( $user );
        if ( $overwriteError !== true ) {
            return array( array( $overwriteError ) );
        }


Changing the code in SpecialUpload to             

            $code = array_shift( $permErrors[0] );

            $this->showRecoverableUploadError( wfMsgExt( $code[0],
                    'parseinline', $code[1] ) );

will then fix it.

I've just no idea if/how that'll actually break the more generic permission
checks. I'm not sure on their format, but I'm guessing it probably will.

Will attach a patch with these propose changed


The fix might actually be changing

            $code = array_shift( $permErrors[0] );
            $this->showRecoverableUploadError( wfMsgExt( $code,
                    'parseinline', $permErrors[0] ) );

into something that the $permErrors[0] is replaced by some variant of
$file->getName();


Need to defer to Bryan/thedj for advice on whether I'll break the current error
handling (which looks vague at best currently). Patch incoming

-- 
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