From 9cc5f32b22d29dc6c7aa50f6c65afdfe6d1dda78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Thu, 17 Oct 2013 18:14:52 +0200 Subject: [PATCH] MDL-42386 fix invalid etag comparison Credit goes to Eloy Lafuente, thanks! --- lib/filelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/filelib.php b/lib/filelib.php index 364e43f0289..13d1569e40f 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -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; }