mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 05:55:02 +03:00
Поддержка JSONP запросов
This commit is contained in:
parent
84d42c5a35
commit
06c5580c75
|
@ -359,6 +359,11 @@ class ModuleViewer extends Module {
|
|||
header('Content-type: application/json');
|
||||
}
|
||||
echo json_encode($this->aVarsAjax);
|
||||
} elseif ($sType=='jsonp') {
|
||||
if (!headers_sent()) {
|
||||
header('Content-type: application/json');
|
||||
}
|
||||
echo getRequest('jsonpCallback','callback').'('.json_encode($this->aVarsAjax).');';
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
@ -377,7 +382,10 @@ class ModuleViewer extends Module {
|
|||
$JsHttpRequest = new JsHttpRequest("UTF-8");
|
||||
}
|
||||
}
|
||||
// Для возможности кросс-доменных запросов
|
||||
if ($sResponseAjax!='jsonp') {
|
||||
$this->Security_ValidateSendForm();
|
||||
}
|
||||
$this->sResponseAjax=$sResponseAjax;
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue