Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1753,6 +1753,7 @@ |
1754 | 1754 | 'alreadyrolled', |
1755 | 1755 | 'editcomment', |
1756 | 1756 | 'revertpage', |
| 1757 | + 'revertpage-nouser', |
1757 | 1758 | 'rollback-success', |
1758 | 1759 | 'sessionfailure', |
1759 | 1760 | ), |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -3003,6 +3003,8 @@ |
3004 | 3004 | } |
3005 | 3005 | |
3006 | 3006 | $from = str_replace( '_', ' ', $fromP ); |
| 3007 | + # User name given should match up with the top revision. |
| 3008 | + # If the user was deleted then $from should be empty. |
3007 | 3009 | if( $from != $current->getUserText() ) { |
3008 | 3010 | $resultDetails = array( 'current' => $current ); |
3009 | 3011 | return array(array('alreadyrolled', |
— | — | @@ -3012,9 +3014,10 @@ |
3013 | 3015 | )); |
3014 | 3016 | } |
3015 | 3017 | |
3016 | | - # Get the last edit not by this guy |
3017 | | - $user = intval( $current->getUser() ); |
3018 | | - $user_text = $dbw->addQuotes( $current->getUserText() ); |
| 3018 | + # Get the last edit not by this guy... |
| 3019 | + # Note: these may not be public values |
| 3020 | + $user = intval( $current->getRawUser() ); |
| 3021 | + $user_text = $dbw->addQuotes( $current->getRawUserText() ); |
3019 | 3022 | $s = $dbw->selectRow( 'revision', |
3020 | 3023 | array( 'rev_id', 'rev_timestamp', 'rev_deleted' ), |
3021 | 3024 | array( 'rev_page' => $current->getPage(), |
— | — | @@ -3041,20 +3044,24 @@ |
3042 | 3045 | $set['rc_patrolled'] = 1; |
3043 | 3046 | } |
3044 | 3047 | |
3045 | | - if( $set ) { |
| 3048 | + if( count($set) ) { |
3046 | 3049 | $dbw->update( 'recentchanges', $set, |
3047 | | - array( /* WHERE */ |
3048 | | - 'rc_cur_id' => $current->getPage(), |
3049 | | - 'rc_user_text' => $current->getUserText(), |
3050 | | - "rc_timestamp > '{$s->rev_timestamp}'", |
3051 | | - ), __METHOD__ |
3052 | | - ); |
| 3050 | + array( /* WHERE */ |
| 3051 | + 'rc_cur_id' => $current->getPage(), |
| 3052 | + 'rc_user_text' => $current->getUserText(), |
| 3053 | + "rc_timestamp > '{$s->rev_timestamp}'", |
| 3054 | + ), __METHOD__ |
| 3055 | + ); |
3053 | 3056 | } |
3054 | 3057 | |
3055 | 3058 | # Generate the edit summary if necessary |
3056 | 3059 | $target = Revision::newFromId( $s->rev_id ); |
3057 | | - if( empty( $summary ) ){ |
3058 | | - $summary = wfMsgForContent( 'revertpage' ); |
| 3060 | + if( empty( $summary ) ) { |
| 3061 | + if( $from == '' ) { // no public user name |
| 3062 | + $summary = wfMsgForContent( 'revertpage-nouser' ); |
| 3063 | + } else { |
| 3064 | + $summary = wfMsgForContent( 'revertpage' ); |
| 3065 | + } |
3059 | 3066 | } |
3060 | 3067 | |
3061 | 3068 | # Allow the custom summary to use the same args as the default message |
— | — | @@ -3086,8 +3093,8 @@ |
3087 | 3094 | $resultDetails = array( |
3088 | 3095 | 'summary' => $summary, |
3089 | 3096 | 'current' => $current, |
3090 | | - 'target' => $target, |
3091 | | - 'newid' => $revId |
| 3097 | + 'target' => $target, |
| 3098 | + 'newid' => $revId |
3092 | 3099 | ); |
3093 | 3100 | return array(); |
3094 | 3101 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2666,6 +2666,7 @@ |
2667 | 2667 | The last edit to the page was by [[User:$3|$3]] ([[User talk:$3|Talk]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).', |
2668 | 2668 | 'editcomment' => "The edit summary was: \"''\$1''\".", |
2669 | 2669 | 'revertpage' => 'Reverted edits by [[Special:Contributions/$2|$2]] ([[User talk:$2|Talk]]) to last revision by [[User:$1|$1]]', |
| 2670 | +'revertpage-nouser' => 'Reverted edits by (username removed) to last revision by [[User:$1|$1]]', |
2670 | 2671 | 'rollback-success' => 'Reverted edits by $1; |
2671 | 2672 | changed back to last revision by $2.', |
2672 | 2673 | 'sessionfailure' => 'There seems to be a problem with your login session; |