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.
This commit is contained in:
Mikael Nordfeldth
2013-09-24 01:17:04 +02:00
parent 1744fec89f
commit 1c6f9df80e
23 changed files with 50 additions and 102 deletions

View File

@@ -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();
}
}

View File

@@ -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();
}
}