From f4962f22a8fa4bf83b5a2def581588063441c8c1 Mon Sep 17 00:00:00 2001 From: Nathan Nguyen Date: Fri, 16 Nov 2018 10:40:08 +1100 Subject: [PATCH] Fix problem with loading stylesheet in preview mode --- lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.php b/lib.php index dfda31a..9a11d89 100644 --- a/lib.php +++ b/lib.php @@ -75,7 +75,7 @@ function auth_outage_get_climaintenance_resource_file($file) { // Protect against path traversal attacks. $basename = basename($file); - if ($basename !== $file) { + if ($basename !== $file && $file !== 'preview/' . $basename) { // @codingStandardsIgnoreStart if (!PHPUNIT_TEST) { error_log('Possible attempt for Path Traversal Attack (only filename expected): '.$file);