kernelvers.php (fogproject-1.5.7) | : | kernelvers.php (fogproject-1.5.8) | ||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
* @package FOGProject | * @package FOGProject | |||
* @author Tom Elliott <tommygunsster@gmail.com> | * @author Tom Elliott <tommygunsster@gmail.com> | |||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 | * @license http://opensource.org/licenses/gpl-3.0 GPLv3 | |||
* @link https://fogproject.org | * @link https://fogproject.org | |||
*/ | */ | |||
require '../commons/base.inc.php'; | require '../commons/base.inc.php'; | |||
session_write_close(); | session_write_close(); | |||
ignore_user_abort(true); | ignore_user_abort(true); | |||
set_time_limit(0); | set_time_limit(0); | |||
header('Content-Type: text/event-stream'); | header('Content-Type: text/event-stream'); | |||
$url = filter_input(INPUT_GET, 'url'); | $url = filter_input(INPUT_POST, 'url'); | |||
if (!$currentUser->isValid()) { | ||||
echo _('Unauthorized'); | ||||
exit; | ||||
} | ||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) | ||||
|| strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest' | ||||
) { | ||||
echo _('Unauthorized'); | ||||
exit; | ||||
} | ||||
if ($url) { | if ($url) { | |||
$res = $FOGURLRequests | $res = $FOGURLRequests | |||
->process($url); | ->process($url); | |||
foreach ((array)$res as &$response) { | foreach ((array)$res as &$response) { | |||
echo $response; | echo $response; | |||
unset($response); | unset($response); | |||
} | } | |||
exit; | exit; | |||
} | } | |||
$kernelvers = function ($kernel) { | $kernelvers = function ($kernel) { | |||
End of changes. 1 change blocks. | ||||
11 lines changed or deleted | 1 lines changed or added |