Move check for --help to after the command-line checks, so it doesn't
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 16 Nov 2005 07:19:06 +0000 (07:19 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 16 Nov 2005 07:19:06 +0000 (07:19 +0000)
print an ugly warning message when hit in a web browser.
(Path disclosure issue with display_errors on.)

maintenance/changePassword.php

index 1e015fd..526feb7 100644 (file)
@@ -35,7 +35,11 @@ class ChangePassword {
                );
        }
 }
-if ( in_array( '--help', $argv ) )
+
+$optionsWithArgs = array( 'user', 'password' );
+require_once 'commandLine.inc';
+
+if( in_array( '--help', $argv ) )
        die(
                "Usage: php changePassword.php [--user=user --password=password | --help]\n" .
                "\toptions:\n" .
@@ -44,8 +48,5 @@ if ( in_array( '--help', $argv ) )
                "\t\t--password\tthe password to use\n"
        );
 
-$optionsWithArgs = array( 'user', 'password' );
-require_once 'commandLine.inc';
-
 $cp = new ChangePassword( @$options['user'], @$options['password'] );
 $cp->main();