-
- #It would be nice to see where the user had actually come from, but for now just guess
- $returnto = $rc->getAttribute( 'rc_type' ) == RC_NEW ? 'Newpages' : 'Recentchanges';
- $return = Title::makeTitle( NS_SPECIAL, $returnto );
-
- # If it's left up to us, check that the user is allowed to patrol this edit
- # If the user has the "autopatrol" right, then we'll assume there are no
- # other conditions stopping them doing so
- if( !$wgUser->isAllowed( 'autopatrol' ) ) {
- $rc = RecentChange::newFromId( $rcid );
- # Graceful error handling, as we've done before here...
- # (If the recent change doesn't exist, then it doesn't matter whether
- # the user is allowed to patrol it or not; nothing is going to happen
- if( is_object( $rc ) && $wgUser->getName() == $rc->getAttribute( 'rc_user_text' ) ) {
- # The user made this edit, and can't patrol it
- # Tell them so, and then back off
- $wgOut->setPageTitle( wfMsg( 'markedaspatrollederror' ) );
- $wgOut->addWikiMsg( 'markedaspatrollederror-noautopatrol' );
- $wgOut->returnToMain( false, $return );
- return;
- }
+
+ if ( in_array(array('markedaspatrollederror-noautopatrol'), $errors) ) {
+ $wgOut->setPageTitle( wfMsg( 'markedaspatrollederror' ) );
+ $wgOut->addWikiMsg( 'markedaspatrollederror-noautopatrol' );
+ $wgOut->returnToMain( false, $return );
+ return;