Index: trunk/phase3/includes/Article.php |
— | — | @@ -2493,16 +2493,18 @@ |
2494 | 2494 | $resultDetails = null; |
2495 | 2495 | |
2496 | 2496 | # Check permissions |
2497 | | - $errors = array_merge( $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser ), |
2498 | | - $this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser ) ); |
| 2497 | + $editErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser ); |
| 2498 | + $rollbackErrors = $this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser ); |
| 2499 | + $errors = array_merge( $editErrors, wfArrayDiff2( $rollbackErrors, $editErrors ) ); |
| 2500 | + |
2499 | 2501 | if( !$wgUser->matchEditToken( $token, array( $this->mTitle->getPrefixedText(), $fromP ) ) ) |
2500 | 2502 | $errors[] = array( 'sessionfailure' ); |
2501 | 2503 | |
2502 | | - if( $wgUser->pingLimiter('rollback') || $wgUser->pingLimiter() ) { |
| 2504 | + if( $wgUser->pingLimiter( 'rollback' ) || $wgUser->pingLimiter() ) { |
2503 | 2505 | $errors[] = array( 'actionthrottledtext' ); |
2504 | 2506 | } |
2505 | 2507 | # If there were errors, bail out now |
2506 | | - if(!empty($errors)) |
| 2508 | + if( !empty( $errors ) ) |
2507 | 2509 | return $errors; |
2508 | 2510 | |
2509 | 2511 | return $this->commitRollback($fromP, $summary, $bot, $resultDetails); |
— | — | @@ -2637,10 +2639,6 @@ |
2638 | 2640 | $details |
2639 | 2641 | ); |
2640 | 2642 | |
2641 | | - if( in_array( array( 'blocked' ), $result ) ) { |
2642 | | - $wgOut->blockedPage(); |
2643 | | - return; |
2644 | | - } |
2645 | 2643 | if( in_array( array( 'actionthrottledtext' ), $result ) ) { |
2646 | 2644 | $wgOut->rateLimited(); |
2647 | 2645 | return; |
— | — | @@ -2662,7 +2660,7 @@ |
2663 | 2661 | # Display permissions errors before read-only message -- there's no |
2664 | 2662 | # point in misleading the user into thinking the inability to rollback |
2665 | 2663 | # is only temporary. |
2666 | | - if( !empty($result) && $result !== array( array('readonlytext') ) ) { |
| 2664 | + if( !empty( $result ) && $result !== array( array( 'readonlytext' ) ) ) { |
2667 | 2665 | # array_diff is completely broken for arrays of arrays, sigh. Re- |
2668 | 2666 | # move any 'readonlytext' error manually. |
2669 | 2667 | $out = array(); |
— | — | @@ -2674,7 +2672,7 @@ |
2675 | 2673 | $wgOut->showPermissionsErrorPage( $out ); |
2676 | 2674 | return; |
2677 | 2675 | } |
2678 | | - if( $result == array( array('readonlytext') ) ) { |
| 2676 | + if( $result == array( array( 'readonlytext' ) ) ) { |
2679 | 2677 | $wgOut->readOnlyPage(); |
2680 | 2678 | return; |
2681 | 2679 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -389,6 +389,8 @@ |
390 | 390 | markup now. |
391 | 391 | * (bug 16529) Fix for search suggestions with some third-party JS libraries |
392 | 392 | * (bug 13342) importScript() generates more consistent URI encoding |
| 393 | +* (bug 16577) When a blocked user tries to rollback a page, the block message |
| 394 | + is now only displayed once |
393 | 395 | |
394 | 396 | |
395 | 397 | === API changes in 1.14 === |