Skip to main content
Topic: Critical secret answer bug (Read 2925 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Critical secret answer bug

http://www.simplemachines.org/community/index.php?topic=538642.0
This is present in Elkarte as well. It always refuses your secret answer if you do that procedure, no matter if you leave it blank or type the correct reply.
~ SimplePortal Support Team ~

Re: Critical secret answer bug

Reply #1

What a pain in the plumbers crack that profile code... >_<

Dealing with what we have now, I guess this should work:
Code: [Select]
			'input_validate' => create_function('&$value', '
global $cur_profile;

if (empty($value))
{
require_once(SUBSDIR . \'/Members.subs.php\');
$member = getBasicMemberData($cur_profile[\'id_member\'], array(\'authentication\' => true));

// No previous answer was saved, so that\'s all good
if (empty($member[\'secret_answer\']))
{
return true;
}
// There is a previous secret answer to the secret question, so let\'s put it back in the db...
else
{
$value = $member[\'secret_answer\'];
// We have to tell the code is an error otherwise an empty value will go into the db
return false;
}
}
$value = $value != \'\' ? md5($value) : \'\';
return true;
'),

But I'm slightly sleepy and create_function always give me a headache... :-\
Bugs creator.
Features destroyer.
Template killer.

Re: Critical secret answer bug

Reply #2

Quotepain in the plumbers crack
This deserves a like :D

QuoteBut I'm slightly sleepy and create_function always give me a headache... :-\
Then use closures. I think a full disclosure is always nice:  that was a horrible pun.
LiveGallery - Simple gallery addon for ElkArte

Re: Critical secret answer bug

Reply #3

Well, I hope they get it right on SMF as well, not too confident tbh xD
~ SimplePortal Support Team ~

Re: Critical secret answer bug

Reply #4

Quote from: live627 –
Quotepain in the plumbers crack
This deserves a like :D
Another of spuds' censoring. LOL

1.0 is (still) with create_functions, so for consistency it's better to fix it like that, 1.1 is another story. ;D
Bugs creator.
Features destroyer.
Template killer.

Re: Critical secret answer bug

Reply #5

Censorship done right!

Did Spuds censor his name, too?
LiveGallery - Simple gallery addon for ElkArte

Re: Critical secret answer bug

Reply #6

Not recently, that I know of, but several other folks could if they want :D
Last Edit: August 02, 2015, 06:11:55 am by Spuds

Re: Critical secret answer bug

Reply #7

They are still messing with the code at sm.org instead :( shrug
~ SimplePortal Support Team ~