From 55fd34588a8e4fbbbbbb6eef85c58a94ade5b799 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Wed, 11 Jun 2008 13:05:48 +0000 Subject: [PATCH] (NewQuestionaskerDoPost): Only reveal the secret key when a question has been asked (and not after a simple preview). --- modules/questionasker.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/questionasker.pl b/modules/questionasker.pl index da7333f4..b97003ee 100644 --- a/modules/questionasker.pl +++ b/modules/questionasker.pl @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -$ModulesDescription .= '

$Id: questionasker.pl,v 1.24 2008/04/14 11:25:23 as Exp $

'; +$ModulesDescription .= '

$Id: questionasker.pl,v 1.25 2008/06/11 13:05:48 as Exp $

'; use vars qw(@QuestionaskerQuestions $QuestionaskerRememberAnswer @@ -85,7 +85,11 @@ sub NewQuestionaskerDoPost { # warn "Q: '$QuestionaskerQuestions[$question_num][0]', A: '$answer'\n"; return; } - SetParam($QuestionaskerSecretKey, 1) unless GetParam($QuestionaskerSecretKey, 0); + # Set the secret key only if a question has in fact been answered + if (not GetParam($QuestionaskerSecretKey, 0) + and $QuestionaskerQuestions[$question_num][1]($answer)) { + SetParam($QuestionaskerSecretKey, 1) + } return (OldQuestionaskerDoPost(@params)); }