PasswordMaker Forums
September 03, 2010, 11:55:19 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Wrong parameter parsing  (Read 3431 times)
pvx
Newbie
*
Offline Offline

Posts: 1


« on: May 12, 2007, 11:34:56 AM »

PasswordMaker PHP edition 1.3 has a bug in argument parsing. All arguments in code are checked with isset() function, but code begins with setting all arguments to empty string (''), so isset() always returns true and default values for arguments are not set.

Which means that unless you set all arguments, PasswordMaker returns empty string (because error checking doesn't report anything to the user).

Quick fix is to remove (comment) the empty-string-init line:

Code:
//$args = array('alg'=>'md5', 'mpw'=>'', 'url'=>'', 'user'=>'', 'mod'=>'', 'len'=>'', 'charset'=>'', 'pfx'=>'', 'sfx'=>'', LEET=>'');

"Nicer" way would be to replace isset()s with !=''. Also it wouldn't hurt to report errors to the user   (if he enters invalid arguments).

PasswordMaker is a great idea, thanks to all developers!
Logged
Miquel 'Fire' Burns
Administrator
*****
Offline Offline

Posts: 1024


Programmer


WWW
« Reply #1 on: May 13, 2007, 02:44:06 AM »

Changing every !isset with empty should work with the logic the person who wrote that was going for.
Logged
Eric H. Jung
grimholtz
Administrator
*****
Offline Offline

Posts: 3292


WWW
« Reply #2 on: May 13, 2007, 05:18:34 AM »

I see miquel has made the change and checked it into Subversion on SourceForge. Thanks, Miquel! Feel free to publish it in a new release.
Logged
PasswordMaker Forums
   

 Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
anything