Browse Source

Move PHP session into captcha code to prevent unnecessary cookies.

main
discomrade 2 years ago
parent
commit
175022f519
  1. 13
      post.php

13
post.php

@ -169,9 +169,12 @@ elseif (isset($_GET['Newsgroups'])) {
error("NNTPChan: NNTPChan support is disabled"); error("NNTPChan: NNTPChan support is disabled");
} }
session_start(); // Create session cookie if not already done and captchas are enabled
if (!isset($_POST['captcha_cookie']) && isset($_SESSION['captcha_cookie'])) { if ($config['captcha']['enabled'] || $config['report_captcha']) {
$_POST['captcha_cookie'] = $_SESSION['captcha_cookie']; session_start();
if (!isset($_POST['captcha_cookie']) && isset($_SESSION['captcha_cookie'])) {
$_POST['captcha_cookie'] = $_SESSION['captcha_cookie'];
}
} }
if (isset($_POST['delete'])) { if (isset($_POST['delete'])) {
@ -338,7 +341,7 @@ if (isset($_POST['delete'])) {
$resp = curl_exec($ch); $resp = curl_exec($ch);
if ($resp !== '1') { if ($resp !== '1') {
error($config['error']['captcha']); error($config['error']['captcha']);
} }
} }
} }
@ -454,7 +457,7 @@ if (isset($_POST['delete'])) {
$resp = curl_exec($ch); $resp = curl_exec($ch);
if ($resp !== '1') { if ($resp !== '1') {
error($config['error']['captcha'] . error($config['error']['captcha'] .
'<script>if (actually_load_captcha !== undefined) actually_load_captcha("'.$config['captcha']['provider_get'].'", "'.$config['captcha']['extra'].'");</script>'); '<script>if (actually_load_captcha !== undefined) actually_load_captcha("'.$config['captcha']['provider_get'].'", "'.$config['captcha']['extra'].'");</script>');
} }
} }

Loading…
Cancel
Save