Skip to content

Commit 10e3c3c

Browse files
committed
Put captcha reset to useful place
1 parent 7f28144 commit 10e3c3c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

controller/main.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,9 @@ private function display_pb()
333333

334334
if (!empty($error))
335335
{
336-
// Okay, captcha, your job is done.
337-
if (isset($captcha))
338-
{
339-
$captcha->reset();
340-
}
341-
342336
// Remove duplicate entries of the error array
343337
$error = array_unique($error);
344-
// We have errors, we don't insert here, but instead go back to the posting page and tell the user what he did wrong
338+
// We have errors, we don't insert here, but instead go back to the submit page and tell the user what he did wrong
345339
$s_error = implode('<br />', $error);
346340
}
347341
else
@@ -358,6 +352,12 @@ private function display_pb()
358352
'snippet_prune_on' => time() + $this::SECONDS_MONTH * $data['snippet_prune_on'],
359353
);
360354

355+
// Okay, captcha, your job is done.
356+
if (!$this->auth->acl_get('u_pastebin_post_novc') && isset($captcha) && $captcha->is_solved() === true)
357+
{
358+
$captcha->reset();
359+
}
360+
361361
$sql = 'INSERT INTO ' . $this->pastebin_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
362362
$this->db->sql_query($sql);
363363

0 commit comments

Comments
 (0)