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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user