From 12de66b2bfd04e8f91ee6eb5ac7819ab62ae5c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Tue, 9 Jul 2013 08:04:20 +0200 Subject: [PATCH] MDL-40569 fix empty CSS files after cache purging --- lib/csslib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/csslib.php b/lib/csslib.php index 6bf15785fe9..c457aef87e6 100644 --- a/lib/csslib.php +++ b/lib/csslib.php @@ -345,6 +345,11 @@ function css_minify_css($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']); + set_include_path($CFG->libdir . '/minify/lib' . PATH_SEPARATOR . get_include_path()); require_once('Minify.php'); @@ -373,7 +378,7 @@ function css_minify_css($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) {