markup now.
* (bug 16529) Fix for search suggestions with some third-party JS libraries
* (bug 13342) importScript() generates more consistent URI encoding
+* (bug 16577) When a blocked user tries to rollback a page, the block message
+ is now only displayed once
=== API changes in 1.14 ===
$resultDetails = null;
# Check permissions
- $errors = array_merge( $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser ),
- $this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser ) );
+ $editErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser );
+ $rollbackErrors = $this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser );
+ $errors = array_merge( $editErrors, wfArrayDiff2( $rollbackErrors, $editErrors ) );
+
if( !$wgUser->matchEditToken( $token, array( $this->mTitle->getPrefixedText(), $fromP ) ) )
$errors[] = array( 'sessionfailure' );
- if( $wgUser->pingLimiter('rollback') || $wgUser->pingLimiter() ) {
+ if( $wgUser->pingLimiter( 'rollback' ) || $wgUser->pingLimiter() ) {
$errors[] = array( 'actionthrottledtext' );
}
# If there were errors, bail out now
- if(!empty($errors))
+ if( !empty( $errors ) )
return $errors;
return $this->commitRollback($fromP, $summary, $bot, $resultDetails);
$details
);
- if( in_array( array( 'blocked' ), $result ) ) {
- $wgOut->blockedPage();
- return;
- }
if( in_array( array( 'actionthrottledtext' ), $result ) ) {
$wgOut->rateLimited();
return;
# Display permissions errors before read-only message -- there's no
# point in misleading the user into thinking the inability to rollback
# is only temporary.
- if( !empty($result) && $result !== array( array('readonlytext') ) ) {
+ if( !empty( $result ) && $result !== array( array( 'readonlytext' ) ) ) {
# array_diff is completely broken for arrays of arrays, sigh. Re-
# move any 'readonlytext' error manually.
$out = array();
$wgOut->showPermissionsErrorPage( $out );
return;
}
- if( $result == array( array('readonlytext') ) ) {
+ if( $result == array( array( 'readonlytext' ) ) ) {
$wgOut->readOnlyPage();
return;
}