aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/report.php
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-06-11 00:20:26 +0530
committerDhruv <dhruv.goel92@gmail.com>2013-07-01 21:48:57 +0530
commitc4fbed251db058d808823d2700c441383edc3e63 (patch)
treecc0afbc9d36471919614e852c5563c696a266fea /phpBB/report.php
parent2c240f8a7b36feab129336b7e36273cdb9798364 (diff)
downloadforums-c4fbed251db058d808823d2700c441383edc3e63.tar
forums-c4fbed251db058d808823d2700c441383edc3e63.tar.gz
forums-c4fbed251db058d808823d2700c441383edc3e63.tar.bz2
forums-c4fbed251db058d808823d2700c441383edc3e63.tar.xz
forums-c4fbed251db058d808823d2700c441383edc3e63.zip
[ticket/11566] add captcha reset and hidden fields
If captcha is solved and some other error pops up, store the captcha in a hidden field. Reset captcha if reporting the post is successful PHPBB3-11566
Diffstat (limited to 'phpBB/report.php')
-rw-r--r--phpBB/report.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/phpBB/report.php b/phpBB/report.php
index 1ae0abcdc2..b876b5c94f 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -141,6 +141,7 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'])
}
$error = array();
+$s_hidden_fields = '';
// Submit report?
if ($submit && $reason_id)
@@ -165,6 +166,11 @@ if ($submit && $reason_id)
if (!sizeof($error))
{
+ if (isset($captcha))
+ {
+ $captcha->reset();
+ }
+
$sql_ary = array(
'reason_id' => (int) $reason_id,
'post_id' => $post_id,
@@ -235,6 +241,10 @@ if ($submit && $reason_id)
}
trigger_error($message);
}
+ else if (isset($captcha) && $captcha->is_solved() !== false)
+ {
+ $s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields());
+ }
}
// Generate the reasons
@@ -255,6 +265,7 @@ $template->assign_vars(array(
'S_REPORT_POST' => ($pm_id) ? false : true,
'REPORT_TEXT' => $report_text,
'S_REPORT_ACTION' => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $post_id . '&amp;pm=' . $pm_id),
+ 'S_HIDDEN_FIELDS' => (sizeof($s_hidden_fields)) ? $s_hidden_fields : null,
'S_NOTIFY' => $user_notify,
'S_CAN_NOTIFY' => ($user->data['is_registered']) ? true : false)