From a0ad70ecbda4a35c81912e2fd7e9e2e9f6357a6c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 16 Nov 2005 07:19:06 +0000 Subject: [PATCH] Move check for --help to after the command-line checks, so it doesn't print an ugly warning message when hit in a web browser. (Path disclosure issue with display_errors on.) --- maintenance/changePassword.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/maintenance/changePassword.php b/maintenance/changePassword.php index 1e015fdcb4..526feb7986 100644 --- a/maintenance/changePassword.php +++ b/maintenance/changePassword.php @@ -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(); -- 2.20.1