Fix problem with loading stylesheet in preview mode

This commit is contained in:
Nathan Nguyen
2018-11-16 10:40:08 +11:00
parent 1ec50dadb2
commit f4962f22a8

View File

@@ -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);