From 1c6f9df80e7e6927e964fdfdd72fda9b15106ddd Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 24 Sep 2013 01:17:04 +0200 Subject: [PATCH] PHP5.5 fix: Better use of startXML for Action classes (mostly AJAX) I had a problem with PHP5.5 that caused ajax responses to be empty. This fixes it, as the problem was related to pretty inconsistent calling to headers, XMLWriter::startDocument etc. etc. --- actions/conversationreplies.php | 6 ++---- actions/newmessage.php | 4 +--- actions/newnotice.php | 6 ++---- actions/shownotice.php | 6 ++---- lib/atom10feed.php | 2 +- lib/htmloutputter.php | 2 +- plugins/Blog/actions/newblogentry.php | 6 ++---- plugins/Bookmark/actions/newbookmark.php | 12 ++++-------- plugins/Event/actions/cancelrsvp.php | 8 ++------ plugins/Event/actions/newevent.php | 12 ++++-------- plugins/Event/actions/newrsvp.php | 8 ++------ plugins/MobileProfile/MobileProfilePlugin.php | 2 +- plugins/OStatus/actions/ostatusinit.php | 6 ++---- plugins/OStatus/actions/ostatussub.php | 6 ++---- plugins/Poll/actions/newpoll.php | 6 ++---- plugins/Poll/actions/respondpoll.php | 6 ++---- plugins/QnA/actions/qnaclosequestion.php | 6 ++---- plugins/QnA/actions/qnanewanswer.php | 6 ++---- plugins/QnA/actions/qnanewquestion.php | 6 ++---- plugins/QnA/actions/qnareviseanswer.php | 18 ++++++------------ plugins/QnA/actions/qnavote.php | 6 ++---- plugins/UserFlag/actions/clearflag.php | 6 ++---- plugins/UserFlag/actions/flagprofile.php | 6 ++---- 23 files changed, 50 insertions(+), 102 deletions(-) diff --git a/actions/conversationreplies.php b/actions/conversationreplies.php index 55c3efa9e0..49c806fa98 100644 --- a/actions/conversationreplies.php +++ b/actions/conversationreplies.php @@ -73,9 +73,7 @@ class ConversationRepliesAction extends ConversationAction function showAjax() { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Title for conversation page. $this->element('title', null, _m('TITLE','Notice')); @@ -83,6 +81,6 @@ class ConversationRepliesAction extends ConversationAction $this->elementStart('body'); $this->showContent(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } } diff --git a/actions/newmessage.php b/actions/newmessage.php index b1b1c1db06..6816ffae6b 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -194,9 +194,7 @@ class NewmessageAction extends FormAction $this->msg = $msg; if ($this->trimmed('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title on page for sending a direct message. $this->element('title', null, _('New message')); diff --git a/actions/newnotice.php b/actions/newnotice.php index 1c8f956b5d..749cfdecb3 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -174,9 +174,7 @@ class NewnoticeAction extends FormAction Event::handle('EndSaveNewNoticeWeb', array($this, $user, &$content_shortened, &$options)); if (StatusNet::isAjax()) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending a notice. $this->element('title', null, _('Notice posted')); @@ -184,7 +182,7 @@ class NewnoticeAction extends FormAction $this->elementStart('body'); $this->showNotice($notice); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); exit; } else { $returnto = $this->trimmed('returnto'); diff --git a/actions/shownotice.php b/actions/shownotice.php index d892e51409..3b3e50884d 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -250,9 +250,7 @@ class ShownoticeAction extends Action function showAjax() { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Title for page that shows a notice. $this->element('title', null, _m('TITLE','Notice')); @@ -261,7 +259,7 @@ class ShownoticeAction extends Action $nli = new NoticeListItem($this->notice, $this); $nli->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } /** diff --git a/lib/atom10feed.php b/lib/atom10feed.php index d5faafa1b3..2d617326c5 100644 --- a/lib/atom10feed.php +++ b/lib/atom10feed.php @@ -167,7 +167,7 @@ class Atom10Feed extends XMLStringer function initFeed() { - $this->xw->startDocument('1.0', 'UTF-8'); + $this->startXML(); $commonAttrs = array('xml:lang' => 'en-US'); foreach ($this->namespaces as $prefix => $uri) { if ($prefix == '') { diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 9a43ef069e..578518ea41 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -118,7 +118,7 @@ class HTMLOutputter extends XMLOutputter $this->extraHeaders(); if (preg_match("/.*\/.*xml/", $type)) { // Required for XML documents - $this->xw->startDocument('1.0', 'UTF-8'); + $this->startXML(); } $this->xw->writeDTD('html', '-//W3C//DTD XHTML 1.0 Strict//EN', diff --git a/plugins/Blog/actions/newblogentry.php b/plugins/Blog/actions/newblogentry.php index d6421abea2..99fc89f2fb 100644 --- a/plugins/Blog/actions/newblogentry.php +++ b/plugins/Blog/actions/newblogentry.php @@ -120,9 +120,7 @@ class NewblogentryAction extends Action $options); if ($this->boolean('ajax')) { - header('Content-Type: text/xml; charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending a notice. $this->element('title', null, _m('Blog entry saved')); @@ -131,7 +129,7 @@ class NewblogentryAction extends Action $nli = new NoticeListItem($saved, $this); $nli->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($saved->bestUrl(), 303); } diff --git a/plugins/Bookmark/actions/newbookmark.php b/plugins/Bookmark/actions/newbookmark.php index 57be783b38..1c7dd5bc62 100644 --- a/plugins/Bookmark/actions/newbookmark.php +++ b/plugins/Bookmark/actions/newbookmark.php @@ -150,9 +150,7 @@ class NewbookmarkAction extends Action } catch (ClientException $ce) { if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after an AJAX error occurs $this->element('title', null, _('Ajax Error')); @@ -160,7 +158,7 @@ class NewbookmarkAction extends Action $this->elementStart('body'); $this->element('p', array('id' => 'error'), $ce->getMessage()); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); return; } else { $this->error = $ce->getMessage(); @@ -170,9 +168,7 @@ class NewbookmarkAction extends Action } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after posting a bookmark. $this->element('title', null, _m('Bookmark posted')); @@ -180,7 +176,7 @@ class NewbookmarkAction extends Action $this->elementStart('body'); $this->showNotice($saved); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($saved->bestUrl(), 303); } diff --git a/plugins/Event/actions/cancelrsvp.php b/plugins/Event/actions/cancelrsvp.php index ab6cc5037e..1a30e86a1e 100644 --- a/plugins/Event/actions/cancelrsvp.php +++ b/plugins/Event/actions/cancelrsvp.php @@ -150,20 +150,16 @@ class CancelrsvpAction extends Action } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending a notice. $this->element('title', null, _m('Event saved')); $this->elementEnd('head'); $this->elementStart('body'); - $this->elementStart('body'); $form = new RSVPForm($this->event, $this); $form->show(); $this->elementEnd('body'); - $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } } diff --git a/plugins/Event/actions/newevent.php b/plugins/Event/actions/newevent.php index 4c2157e01e..cd26490602 100644 --- a/plugins/Event/actions/newevent.php +++ b/plugins/Event/actions/newevent.php @@ -244,9 +244,7 @@ class NeweventAction extends Action } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending a notice. $this->element('title', null, _m('Event saved')); @@ -254,7 +252,7 @@ class NeweventAction extends Action $this->elementStart('body'); $this->showNotice($saved); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($saved->bestUrl(), 303); } @@ -263,9 +261,7 @@ class NeweventAction extends Action // @todo factor this out into a base class function outputAjaxError($msg) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after an AJAX error occurs $this->element('title', null, _('Ajax Error')); @@ -273,7 +269,7 @@ class NeweventAction extends Action $this->elementStart('body'); $this->element('p', array('id' => 'error'), $msg); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); return; } diff --git a/plugins/Event/actions/newrsvp.php b/plugins/Event/actions/newrsvp.php index 272c6f0d9f..cbe67ae173 100644 --- a/plugins/Event/actions/newrsvp.php +++ b/plugins/Event/actions/newrsvp.php @@ -155,20 +155,16 @@ class NewrsvpAction extends Action if ($this->boolean('ajax')) { $rsvp = RSVP::fromNotice($saved); - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after creating an event. $this->element('title', null, _m('Event saved')); $this->elementEnd('head'); $this->elementStart('body'); - $this->elementStart('body'); $cancel = new CancelRSVPForm($rsvp, $this); $cancel->show(); $this->elementEnd('body'); - $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($saved->bestUrl(), 303); } diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 0eb57035d1..6e682a4f87 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -209,7 +209,7 @@ class MobileProfilePlugin extends WAP20Plugin $action->extraHeaders(); if (preg_match("/.*\/.*xml/", $type)) { // Required for XML documents - $action->xw->startDocument('1.0', 'UTF-8'); + $action->startXML(); } $action->xw->writeDTD('html', '-//WAPFORUM//DTD XHTML Mobile 1.0//EN', diff --git a/plugins/OStatus/actions/ostatusinit.php b/plugins/OStatus/actions/ostatusinit.php index c7c8baa526..f559eec3e3 100644 --- a/plugins/OStatus/actions/ostatusinit.php +++ b/plugins/OStatus/actions/ostatusinit.php @@ -80,9 +80,7 @@ class OStatusInitAction extends Action { $this->err = $err; if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Form title. $this->element('title', null, _m('TITLE','Subscribe to user')); @@ -90,7 +88,7 @@ class OStatusInitAction extends Action $this->elementStart('body'); $this->showContent(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { $this->showPage(); } diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php index 59bd6761ca..f27c3658b1 100644 --- a/plugins/OStatus/actions/ostatussub.php +++ b/plugins/OStatus/actions/ostatussub.php @@ -373,9 +373,7 @@ class OStatusSubAction extends Action $this->error = $err; } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Form title. $this->element('title', null, _m('Subscribe to user')); @@ -383,7 +381,7 @@ class OStatusSubAction extends Action $this->elementStart('body'); $this->showContent(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { $this->showPage(); } diff --git a/plugins/Poll/actions/newpoll.php b/plugins/Poll/actions/newpoll.php index e7d5d3dd0d..ed73140e2f 100644 --- a/plugins/Poll/actions/newpoll.php +++ b/plugins/Poll/actions/newpoll.php @@ -158,9 +158,7 @@ class NewPollAction extends Action } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending a notice. $this->element('title', null, _m('Notice posted')); @@ -168,7 +166,7 @@ class NewPollAction extends Action $this->elementStart('body'); $this->showNotice($saved); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($saved->bestUrl(), 303); } diff --git a/plugins/Poll/actions/respondpoll.php b/plugins/Poll/actions/respondpoll.php index df3f68e87c..8de9292417 100644 --- a/plugins/Poll/actions/respondpoll.php +++ b/plugins/Poll/actions/respondpoll.php @@ -144,9 +144,7 @@ class RespondPollAction extends Action } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending a poll response. $this->element('title', null, _m('Poll results')); @@ -155,7 +153,7 @@ class RespondPollAction extends Action $form = new PollResultForm($this->poll, $this); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($this->poll->bestUrl(), 303); } diff --git a/plugins/QnA/actions/qnaclosequestion.php b/plugins/QnA/actions/qnaclosequestion.php index 87a848987c..9a72b21809 100644 --- a/plugins/QnA/actions/qnaclosequestion.php +++ b/plugins/QnA/actions/qnaclosequestion.php @@ -147,9 +147,7 @@ class QnaclosequestionAction extends Action } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending an answer. $this->element('title', null, _m('Answers')); @@ -158,7 +156,7 @@ class QnaclosequestionAction extends Action $form = new QnashowquestionForm($this, $this->question); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($this->question->bestUrl(), 303); } diff --git a/plugins/QnA/actions/qnanewanswer.php b/plugins/QnA/actions/qnanewanswer.php index 661cbcc328..92b640c166 100644 --- a/plugins/QnA/actions/qnanewanswer.php +++ b/plugins/QnA/actions/qnanewanswer.php @@ -151,10 +151,8 @@ class QnanewanswerAction extends Action if ($this->boolean('ajax')) { common_debug("ajaxy part"); $answer = $this->question->getAnswer($profile); - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending an answer. $this->element('title', null, _m('Answers')); @@ -166,7 +164,7 @@ class QnanewanswerAction extends Action $nli->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_debug("not ajax"); common_redirect($this->question->bestUrl(), 303); diff --git a/plugins/QnA/actions/qnanewquestion.php b/plugins/QnA/actions/qnanewquestion.php index d6584b8f44..9fc05e7818 100644 --- a/plugins/QnA/actions/qnanewquestion.php +++ b/plugins/QnA/actions/qnanewquestion.php @@ -148,9 +148,7 @@ class QnanewquestionAction extends Action } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending a notice. $this->element('title', null, _m('Question posted')); @@ -158,7 +156,7 @@ class QnanewquestionAction extends Action $this->elementStart('body'); $this->showNotice($saved); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($saved->bestUrl(), 303); } diff --git a/plugins/QnA/actions/qnareviseanswer.php b/plugins/QnA/actions/qnareviseanswer.php index 707a81f8ac..c08edb2cc3 100644 --- a/plugins/QnA/actions/qnareviseanswer.php +++ b/plugins/QnA/actions/qnareviseanswer.php @@ -155,9 +155,7 @@ class QnareviseanswerAction extends Action } if ($this->boolean('ajax')) { common_debug("ajaxy part"); - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending an answer. $this->element('title', null, _m('Answer')); @@ -166,7 +164,7 @@ class QnareviseanswerAction extends Action $form = new QnashowanswerForm($this, $answer); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($this->answer->bestUrl(), 303); } @@ -199,9 +197,7 @@ class QnareviseanswerAction extends Action } if ($this->boolean('ajax')) { common_debug("ajaxy part"); - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending an answer. $this->element('title', null, _m('Answer')); @@ -210,7 +206,7 @@ class QnareviseanswerAction extends Action $form = new QnashowanswerForm($this, $answer); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($this->answer->bestUrl(), 303); } @@ -239,9 +235,7 @@ class QnareviseanswerAction extends Action function showAjaxReviseForm() { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Form title for sending an answer. $this->element('title', null, _m('TITLE','Answer')); @@ -250,7 +244,7 @@ class QnareviseanswerAction extends Action $form = new QnareviseanswerForm($this->answer, $this); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } /** diff --git a/plugins/QnA/actions/qnavote.php b/plugins/QnA/actions/qnavote.php index df4898dfe9..5e227a69ce 100644 --- a/plugins/QnA/actions/qnavote.php +++ b/plugins/QnA/actions/qnavote.php @@ -142,9 +142,7 @@ class Qnavote extends Action } if ($this->boolean('ajax')) { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Page title after sending in a vote for a question or answer. $this->element('title', null, _m('Answers')); @@ -153,7 +151,7 @@ class Qnavote extends Action $form = new QnA_Answer($this->question, $this); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { common_redirect($this->question->bestUrl(), 303); } diff --git a/plugins/UserFlag/actions/clearflag.php b/plugins/UserFlag/actions/clearflag.php index e5704d6af5..c2443d6d58 100644 --- a/plugins/UserFlag/actions/clearflag.php +++ b/plugins/UserFlag/actions/clearflag.php @@ -121,9 +121,7 @@ class ClearflagAction extends ProfileFormAction */ function ajaxResults() { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Title for AJAX form to indicated that flags were removed. $this->element('title', null, _m('Flags cleared')); @@ -132,6 +130,6 @@ class ClearflagAction extends ProfileFormAction // TRANS: Body element for "flags cleared" form. $this->element('p', 'cleared', _m('Cleared')); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } } diff --git a/plugins/UserFlag/actions/flagprofile.php b/plugins/UserFlag/actions/flagprofile.php index 7096d3748e..4c4dc46f60 100644 --- a/plugins/UserFlag/actions/flagprofile.php +++ b/plugins/UserFlag/actions/flagprofile.php @@ -117,9 +117,7 @@ class FlagprofileAction extends ProfileFormAction */ function ajaxResults() { - header('Content-Type: text/xml;charset=utf-8'); - $this->xw->startDocument('1.0', 'UTF-8'); - $this->elementStart('html'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: AJAX form title for a flagged profile. $this->element('title', null, _m('Flagged for review')); @@ -128,6 +126,6 @@ class FlagprofileAction extends ProfileFormAction // TRANS: Body text for AJAX form when a profile has been flagged for review. $this->element('p', 'flagged', _m('Flagged')); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } }