From 4eac561cf69279407b8e231ddf6010e9b7826411 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 29 Jun 2011 21:55:28 +0000 Subject: [PATCH] Fix ajax error output --- plugins/Bookmark/newbookmark.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/Bookmark/newbookmark.php b/plugins/Bookmark/newbookmark.php index d60d3d4670..57be783b38 100644 --- a/plugins/Bookmark/newbookmark.php +++ b/plugins/Bookmark/newbookmark.php @@ -150,7 +150,18 @@ class NewbookmarkAction extends Action } catch (ClientException $ce) { if ($this->boolean('ajax')) { - throw $ce; + header('Content-Type: text/xml;charset=utf-8'); + $this->xw->startDocument('1.0', 'UTF-8'); + $this->elementStart('html'); + $this->elementStart('head'); + // TRANS: Page title after an AJAX error occurs + $this->element('title', null, _('Ajax Error')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->element('p', array('id' => 'error'), $ce->getMessage()); + $this->elementEnd('body'); + $this->elementEnd('html'); + return; } else { $this->error = $ce->getMessage(); $this->showPage(); -- 2.39.5