From 3dd51921dee9ceac160b03516353c8ffb27847b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Fri, 26 Jul 2013 16:44:12 +0200 Subject: [PATCH] MDL-40889 prevent 304 when minimising JS --- lib/jslib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/jslib.php b/lib/jslib.php index bbfb895e534..b763038406c 100644 --- a/lib/jslib.php +++ b/lib/jslib.php @@ -107,6 +107,11 @@ function js_minify($files) { return ''; } + // We do not really want any 304 here! + // There does not seem to be any better way to prevent them here. + unset($_SERVER['HTTP_IF_NONE_MATCH']); + unset($_SERVER['HTTP_IF_MODIFIED_SINCE']); + if (0 === stripos(PHP_OS, 'win')) { Minify::setDocRoot(); // IIS may need help } @@ -132,7 +137,7 @@ function js_minify($files) { $error = 'unknown'; try { $result = Minify::serve('Files', $options); - if ($result['success']) { + if ($result['success'] and $result['statusCode'] == 200) { return $result['content']; } } catch (Exception $e) {