Commit 37bb2328 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Missing Cookie error message: removed, cause for autocron jobs (via wget) there is no cookie

parent 925a47f1
Pipeline #775 passed with stage
in 1 minute and 46 seconds
......@@ -45,25 +45,26 @@ class DownloadPage {
throw new UserReportException("php.ini: 'allow_url_fopen' is off and needs to be open to get '$page''", ERROR_DOWNLOAD_FOPEN_BLOCKED);
}
if (!isset($_COOKIE[SESSION_NAME])) {
throw new UserReportException('Error: missing QFQ cookie - allow cookies in your browser', ERROR_MISSING_COOKIE);
}
// Download page
$ctx = array(
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
),
// Copy cookie: to forward current QFQ user session
'http' => array(
'method' => "GET",
'header' => "Accept-language: en\r\n" .
"Cookie: " . SESSION_NAME . "=" . $_COOKIE[SESSION_NAME] . "\r\n",
),
);
if (isset($_COOKIE[SESSION_NAME])) {
$cookie = array(
// Copy cookie: to forward current QFQ user session
'http' => array(
'method' => "GET",
'header' => "Accept-language: en\r\n" .
"Cookie: " . SESSION_NAME . "=" . $_COOKIE[SESSION_NAME] . "\r\n",
),
);
$ctx = array_merge($ctx,$cookie);
}
// The current session needs to be closed, cause the SESSION needs to be opened again by processing get_file_contents()
// T3 is started again to render the requested page
Session::close();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment