Fix refreshing of captcha broken if a cache-control set by server
This commit is contained in:
parent
6e906ac0e3
commit
fbeb66fedd
@ -59,7 +59,7 @@ if (empty($img))
|
||||
}
|
||||
|
||||
// Define mime type
|
||||
top_httphead('image/png');
|
||||
top_httphead('image/png', 1);
|
||||
|
||||
$background_color = imagecolorallocate($img, 250, 250, 250);
|
||||
$ecriture_color = imagecolorallocate($img, 0, 0, 0);
|
||||
|
||||
@ -1047,9 +1047,10 @@ if (! function_exists("llxHeader"))
|
||||
* Show HTTP header
|
||||
*
|
||||
* @param string $contenttype Content type. For example, 'text/html'
|
||||
* @param int $forcenocache Force disabling of cache for the page
|
||||
* @return void
|
||||
*/
|
||||
function top_httphead($contenttype='text/html')
|
||||
function top_httphead($contenttype='text/html', $forcenocache=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -1066,6 +1067,10 @@ function top_httphead($contenttype='text/html')
|
||||
// default-src https://cdn.example.net; object-src 'none'
|
||||
header("Content-Security-Policy: ".$conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY);
|
||||
}
|
||||
if ($forcenocache)
|
||||
{
|
||||
header("Cache-Control: no-cache, no-store, must-revalidate, max-age=0");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user