summaryrefslogtreecommitdiff
path: root/inc/display.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-09-17 10:43:44 -0400
committerczaks <marcin@6irc.net>2013-09-17 10:43:44 -0400
commit6cb7eb939e549f978ca6dd7d2afe2dabc0f18025 (patch)
tree8b2342bbf5c15847717db733ecf4f2f46718dacb /inc/display.php
parent069f1def9bf8c8d769afdc5740e9ff13271065bd (diff)
parent803f0c8ce1487ea791824197de9d1ee140127838 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard into vichan-devel-4.5
Conflicts: inc/config.php inc/display.php inc/mod/pages.php install.php js/quick-reply.js post.php templates/index.html
Diffstat (limited to 'inc/display.php')
-rw-r--r--inc/display.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/inc/display.php b/inc/display.php
index 736fdc03..6f42cdf9 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -88,6 +88,14 @@ function error($message, $priority = true, $debug_stuff = false) {
// Return the bad request header, necessary for AJAX posts
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
+ // Is there a reason to disable this?
+ if (isset($_POST['json_response'])) {
+ header('Content-Type: text/json; charset=utf-8');
+ die(json_encode(array(
+ 'error' => $message
+ )));
+ }
+
die(Element('page.html', array(
'config' => $config,
'title' => _('Error'),
@@ -536,6 +544,8 @@ class Thread {
$hasnoko50 = $this->postCount() >= $config['noko50_min'];
+ event('show-thread', $this);
+
$built = Element('post_thread.html', array('config' => $config, 'board' => $board, 'post' => &$this, 'index' => $index, 'hasnoko50' => $hasnoko50, 'isnoko50' => $isnoko50));
return $built;