Page MenuHomePhabricator

$wgEmailConfirmToEdit = true influences behavior of $oTitle->userCan()
Closed, ResolvedPublic

Description

I think I found a bug in the method userCan() of the Title object. We often use userCan( 'read' ) to ensure that the user is allowed to read the page or that some context is displayed like an extension. If $wgEmailConfirmToEdit is set to true, the behavior of userCan() isn't as expected. Every user, group doesn't matter, who doesn't have a confirmed E-Mail address fails in this check, because in the method checkUserBlock() the error 'confirmedittext' is added to the errors array. The documentation of this method says this check is done to 'Check that the user isn't blocked from editting', but this error is set on every action expect for 'createaccount'.


Version: 1.17.x
Severity: normal

Details

Reference
bz38709

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:03 AM
bzimport set Reference to bz38709.
bzimport added a subscriber: Unknown Object (MLST).

Until 1.18, Title::userCan() does not work correctly for 'read' permission, use Title::userCanRead() instead. This works correctly since 1.19.

  • This bug has been marked as a duplicate of bug 26020 ***

Thanks a lot for your response! I searched if this bug is already reported but i didn't found a right match. Ok so we will use Title::userCanRead().