From: Zach Copley Date: Wed, 29 Jun 2011 21:55:28 +0000 (+0000) Subject: Fix ajax error output X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4eac561cf69279407b8e231ddf6010e9b7826411;p=quix0rs-gnu-social.git Fix ajax error output --- 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();