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

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

View File

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