Forums / Basic Configuration / Password Retrieval Returns Error (too few arguments)

Password Retrieval Returns Error (too few arguments)

Locked

Started by fwood on 9 Apr 2010, 5:36 PM · Views: 572

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
9 Apr 2010, 5:36 PM
#1
fwood avatar

fwood

New Zenner

Join Date:
May 2004
Posts:
50
Plugin Contributions:
0

Password Retrieval Returns Error (too few arguments)

When trying to retrieve password the form has an error that appears above the form and it does not send a password.

Warning: sprintf() [function.sprintf]: Too few arguments in /home/davesmar/public_html/boats/renamed_admin/password_forgotten.php on line 65

I did not see any reason for it. Any thoughts appreciated

9 Apr 2010, 8:15 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Password Retrieval Returns Error (too few arguments)

The script replaces "%s" in your define for TEXT_EMAIL_MESSAGE with a new password. However, if you've changed the definition of TEXT_EMAIL_MESSAGE to have more than 1 "%s" placeholder (or none at all) then you'll get the error message you're reporting.

You need to fix your language file for password_forgotten

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

10 Apr 2010, 2:35 PM
#3
fwood avatar

fwood

New Zenner

Join Date:
May 2004
Posts:
50
Plugin Contributions:
0

Re: Password Retrieval Returns Error (too few arguments)

DrByte:

The script replaces "%s" in your define for TEXT_EMAIL_MESSAGE with a new password. However, if you've changed the definition of TEXT_EMAIL_MESSAGE to have more than 1 "%s" placeholder (or none at all) then you'll get the error message you're reporting.

You need to fix your language file for password_forgotten

Thank you very much for your reply. I read the code and interpreted as such. As I stated I see no obvious reason. The file has not been changed, so there is nothing to fix there. I also replaced the file, in case it had been corrupted.

When the last security patch came out. Was there any talk of this same problem happening?

10 Apr 2010, 6:30 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Password Retrieval Returns Error (too few arguments)

Yours is the first I've ever seen of this particular problem.

I suppose one other possibility could be that you've set "Minimum Password Length" (in Admin->Configuration->Minimum Values) to 0 and thus the new password being generated is empty and throwing an error, although I would have expected it to simply show "blank" (and no error) instead of null and an error.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.