]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix ajax error output
authorZach Copley <zach@status.net>
Wed, 29 Jun 2011 21:55:28 +0000 (21:55 +0000)
committerZach Copley <zach@status.net>
Wed, 29 Jun 2011 21:55:28 +0000 (21:55 +0000)
plugins/Bookmark/newbookmark.php

index d60d3d4670caab9b70be04257e7f8fa96abea0d7..57be783b3805003ad8d4ba8941ded6ae75bc77c2 100644 (file)
@@ -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();