MDL-42386 fix invalid etag comparison

Credit goes to Eloy Lafuente, thanks!
This commit is contained in:
Petr Škoda
2013-10-18 14:48:40 +02:00
parent 4e47920f08
commit 9cc5f32b22
+1 -1
View File
@@ -2017,7 +2017,7 @@ function readfile_accel($file, $mimetype, $accelerate) {
if (is_object($file)) {
header('Etag: "' . $file->get_contenthash() . '"');
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) and $_SERVER['HTTP_IF_NONE_MATCH'] === $file->get_contenthash()) {
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) and trim($_SERVER['HTTP_IF_NONE_MATCH'], '"') === $file->get_contenthash()) {
header('HTTP/1.1 304 Not Modified');
return;
}