$errors[] = array( 'immobile-target-page' );
}
} elseif ( $action == 'delete' ) {
+ $tempErrors = $this->checkPageRestrictions( 'edit',
+ $user, array(), $doExpensiveQueries, true );
+ if( !$tempErrors ) {
+ $tempErrors = $this->checkCascadingSourcesRestrictions( 'edit',
+ $user, $tempErrors, $doExpensiveQueries, true );
+ }
+ if ( $tempErrors ) {
+ // If protection keeps them from editing, they shouldn't be able to delete.
+ $errors[] = array( 'deleteprotected' );
+ }
if ( $doExpensiveQueries && $wgDeleteRevisionsLimit
&& !$this->userCan( 'bigdelete', $user ) && $this->isBigDeletion()
) {