summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-09-15 14:03:27 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-09-15 14:03:27 +1000
commit00833eeafd6e0f71390504ac10ddf86bbaceb39f (patch)
tree2ca84516f2b7d44efe88b9aa2e609bef0dd32fd7 /post.php
parentfd5300a49e67f9401b821404a146b338bc21dd8a (diff)
js/ajax.js: post with ajax
Diffstat (limited to 'post.php')
-rw-r--r--post.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/post.php b/post.php
index 1fe3b35f..0bc26f46 100644
--- a/post.php
+++ b/post.php
@@ -743,7 +743,15 @@ if (isset($_POST['delete'])) {
else
rebuildThemes('post', $board['uri']);
- header('Location: ' . $redirect, true, $config['redirect_http']);
+ if (!isset($_POST['json_response'])) {
+ header('Location: ' . $redirect, true, $config['redirect_http']);
+ } else {
+ header('Content-Type: text/json; charset=utf-8');
+ echo json_encode(array(
+ 'redirect' => $redirect,
+ 'id' => $id
+ ));
+ }
} else {
if (!file_exists($config['has_installed'])) {
header('Location: install.php', true, $config['redirect_http']);