com web/bugs: - (More places to) tell user to enable cookies if session captcha answer is missing. - Clarify captcha needs to be redone before
resubmitting after the "Are you sure that you searched" question - Bug #66393: www/bug.php www/report.php
| From: | Daniel Convissor | Date: | Sun, 05 Jan 2014 01:41:14 +0000 |
| Subject: | com web/bugs: - (More places to) tell user to enable cookies if session captcha answer is missing. - Clarify captcha needs to be redone before resubmitting after the "Are you sure that you searched" question - Bug #66393: www/bug.php www/report.php |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18037@lists.php.net to get a copy of this message | ||
Commit: d9d5452aa779b71ae421bb06495bd7e9a919acd2
Author: Daniel Convissor <danielc@analysisandsolutions.com> Sat, 4 Jan 2014
20:41:14 -0500
Parents: a8c0a63e1fec559054e65bf0609d340367a55555
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=d9d5452aa779b71ae421bb06495bd7e9a919acd2
Log:
- (More places to) tell user to enable cookies if session captcha answer is missing.
- Clarify captcha needs to be redone before resubmitting after the "Are you sure that you
searched" question
- Bug #66393
Bugs:
https://bugs.php.net/66393
Changed paths:
M www/bug.php
M www/report.php
Diff:
diff --git a/www/bug.php b/www/bug.php
index a90d661..d417a6d 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -63,7 +63,9 @@ if (isset($_POST['subscribe_to_bug']) ||
isset($_POST['unsubscribe_to_bug'])) {
// Check if session answer is set, then compare it with the post captcha value.
// If it's not the same, then it's an incorrect password.
if (!$logged_in) {
- if (!isset($_SESSION['answer']) || $_POST['captcha'] !=
$_SESSION['answer']) {
+ if (!isset($_SESSION['answer'])) {
+ $errors[] = 'Please enable cookies so the Captcha system can work';
+ } elseif ($_POST['captcha'] != $_SESSION['answer']) {
$errors[] = 'Incorrect Captcha';
}
}
@@ -1005,7 +1007,14 @@ if (!$logged_in) {
</td>
</tr>
<tr>
- <th>Solve the problem:<br /><?php echo $captcha; ?> = ?</th>
+<?php
+if (!empty($_POST['captcha']) && empty($ok_to_submit_report)) {
+ $captcha_label = 'Please solve this <em>new</em> problem:';
+} else {
+ $captcha_label = 'Solve the problem:';
+}
+?>
+ <th><?php echo $captcha_label; ?><br /><?php echo
htmlspecialchars($captcha); ?> = ?</th>
<td class="form-input"><input type="text" name="captcha"
/></td>
</tr>
<tr>
diff --git a/www/report.php b/www/report.php
index c31174b..4bb0218 100644
--- a/www/report.php
+++ b/www/report.php
@@ -33,7 +33,9 @@ if (isset($_POST['in'])) {
// Check if session answer is set, then compare it with the post captcha value.
// If it's not the same, then it's an incorrect password.
if (!$logged_in) {
- if (!isset($_SESSION['answer']) || $_POST['captcha'] !=
$_SESSION['answer']) {
+ if (!isset($_SESSION['answer'])) {
+ $errors[] = 'Please enable cookies so the Captcha system can work';
+ } elseif ($_POST['captcha'] != $_SESSION['answer']) {
$errors[] = 'Incorrect Captcha';
}
if (is_spam($_POST['in']['ldesc']) ||