Added map and scss to the isSafeFile function (#913)

This commit is contained in:
Robert 2023-10-27 17:25:29 +02:00 committed by GitHub
parent 954b31d477
commit b6a4e88f7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

5
system/extensions/core.php Normal file → Executable file
View file

@ -2,7 +2,7 @@
// Core extension, https://github.com/annaesvensson/yellow-core
class YellowCore {
const VERSION = "0.8.124";
const VERSION = "0.8.125";
const RELEASE = "0.8.23";
public $content; // content files
public $media; // media files
@ -1806,7 +1806,7 @@ class YellowLookup {
// Check if file is a well-known file type
public function isSafeFile($fileName) {
return preg_match("/\.(css|gif|ico|js|jpg|png|svg|woff|woff2)$/", $fileName);
return preg_match("/\.(css|gif|ico|js|jpg|map|png|scss|svg|woff|woff2)$/", $fileName);
}
// Check if file is valid
@ -1961,6 +1961,7 @@ class YellowToolbox {
"jpg" => "image/jpeg",
"md" => "text/markdown",
"png" => "image/png",
"scss" => "text/x-scss",
"svg" => "image/svg+xml",
"txt" => "text/plain",
"woff" => "application/font-woff",