forked from GNUsocial/gnu-social
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:
@@ -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();
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user