summaryrefslogtreecommitdiff
path: root/maintenance/undelete.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/undelete.php')
-rw-r--r--maintenance/undelete.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/maintenance/undelete.php b/maintenance/undelete.php
index 7213d096..1c3b14a5 100644
--- a/maintenance/undelete.php
+++ b/maintenance/undelete.php
@@ -44,6 +44,9 @@ class Undelete extends Maintenance {
$this->error( "Invalid title", true );
}
$wgUser = User::newFromName( $user );
+ if ( !$wgUser ) {
+ $this->error( "Invalid username", true );
+ }
$archive = new PageArchive( $title );
$this->output( "Undeleting " . $title->getPrefixedDBkey() . '...' );
$archive->undelete( array(), $reason );