|
|
@ -230,10 +230,17 @@ if (isset($_POST['delete'])) { |
|
|
|
if ($password != '' && $post['password'] != $password && (!$thread || $thread['password'] != $password)) |
|
|
|
error($config['error']['invalidpassword']); |
|
|
|
|
|
|
|
if ($post['time'] > time() - $config['delete_time'] && (!$thread || $thread['password'] != $password)) { |
|
|
|
error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time']))); |
|
|
|
if ($post['thread'] == NULL) { |
|
|
|
if ($post['time'] > time() - $config['delete_time_op'] && (!$thread || $thread['password'] != $password)) { |
|
|
|
error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time_op']))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
if ($post['time'] > time() - $config['delete_time_reply'] && (!$thread || $thread['password'] != $password)) { |
|
|
|
error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time_reply']))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($_POST['file'])) { |
|
|
|
// Delete just the file |
|
|
|
deleteFile($id); |
|
|
@ -423,20 +430,20 @@ if (isset($_POST['delete'])) { |
|
|
|
} |
|
|
|
// Same, but now with our custom captcha provider |
|
|
|
if (($config['captcha']['enabled']) || (($post['op']) && ($config['new_thread_capt'])) ) { |
|
|
|
$ch = curl_init($config['domain'].'/'.$config['captcha']['provider_check'] . "?" . http_build_query([ |
|
|
|
'mode' => 'check', |
|
|
|
'text' => $_POST['captcha_text'], |
|
|
|
'extra' => $config['captcha']['extra'], |
|
|
|
'cookie' => $_POST['captcha_cookie'] |
|
|
|
])); |
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
|
|
$resp = curl_exec($ch); |
|
|
|
|
|
|
|
if ($resp !== '1') { |
|
|
|
error($config['error']['captcha'] . |
|
|
|
'<script>if (actually_load_captcha !== undefined) actually_load_captcha("'.$config['captcha']['provider_get'].'", "'.$config['captcha']['extra'].'");</script>'); |
|
|
|
$ch = curl_init($config['domain'].'/'.$config['captcha']['provider_check'] . "?" . http_build_query([ |
|
|
|
'mode' => 'check', |
|
|
|
'text' => $_POST['captcha_text'], |
|
|
|
'extra' => $config['captcha']['extra'], |
|
|
|
'cookie' => $_POST['captcha_cookie'] |
|
|
|
])); |
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
|
|
$resp = curl_exec($ch); |
|
|
|
|
|
|
|
if ($resp !== '1') { |
|
|
|
error($config['error']['captcha'] . |
|
|
|
'<script>if (actually_load_captcha !== undefined) actually_load_captcha("'.$config['captcha']['provider_get'].'", "'.$config['captcha']['extra'].'");</script>'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!(($post['op'] && $_POST['post'] == $config['button_newtopic']) || |
|
|
|
(!$post['op'] && $_POST['post'] == $config['button_reply']))) |
|
|
@ -497,7 +504,6 @@ if (isset($_POST['delete'])) { |
|
|
|
else { |
|
|
|
$thread = false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Check for an embed field |
|
|
|
if ($config['enable_embedding'] && isset($_POST['embed']) && !empty($_POST['embed'])) { |
|
|
|