From 61d6132bb307cc4a89d5085ed01389180b49b348 Mon Sep 17 00:00:00 2001 From: 27chan <27chan@protonmail.com> Date: Wed, 17 Mar 2021 21:22:40 -0300 Subject: [PATCH] Fix post.php I believe that you ended up closing some functions by mistake and then gave the following error when making a post: PHP message: PHP Parse error: syntax error, unexpected '}', expecting end of file in /var/www/vichan/html/post.php on line 462 --- post.php | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/post.php b/post.php index 70a21c5d..be155e84 100644 --- a/post.php +++ b/post.php @@ -402,19 +402,17 @@ if (isset($_POST['delete'])) { if (!$resp['success']) { error($config['error']['captcha']); } - // Same, but now with our custom captcha provider - if (($config['captcha']['enabled']) || (($post['op']) && ($config['new_thread_capt'])) ) { - $resp = file_get_contents($config['captcha']['provider_check'] . "?" . http_build_query([ - 'mode' => 'check', - 'text' => $_POST['captcha_text'], - 'extra' => $config['captcha']['extra'], - 'cookie' => $_POST['captcha_cookie'] - ])); - if ($resp !== '1') { - error($config['error']['captcha'] . - ''); - } - } + // Same, but now with our custom captcha provider + if (($config['captcha']['enabled']) || (($post['op']) && ($config['new_thread_capt'])) ) { + $resp = file_get_contents($config['captcha']['provider_check'] . "?" . http_build_query([ + 'mode' => 'check', + 'text' => $_POST['captcha_text'], + 'extra' => $config['captcha']['extra'], + 'cookie' => $_POST['captcha_cookie'] + ])); + if ($resp !== '1') { + error($config['error']['captcha'] . + ''); } } } @@ -1222,9 +1220,9 @@ if (isset($_POST['delete'])) { 'id' => $id )); } - skip_redirect: + if ($config['try_smarter'] && $post['op']) $build_pages = range(1, $config['max_pages']); @@ -1234,8 +1232,8 @@ if (isset($_POST['delete'])) { event('post-after', $post); buildIndex(); - - if (count($telegrams) > 0) { + + if (count($telegrams) > 0) { $ids = implode(', ', array_map(function($x) { return (int)$x['id']; }, $telegrams)); query("UPDATE ``telegrams`` SET ``seen`` = 1 WHERE ``id`` IN({$ids})") or error(db_error()); die(Element('page.html', array( @@ -1257,7 +1255,7 @@ if (isset($_POST['delete'])) { rebuildThemes('post-thread', $board['uri']); else rebuildThemes('post', $board['uri']); - + } elseif (isset($_POST['appeal'])) { if (!isset($_POST['ban_id'])) error($config['error']['bot']);