From 6cec0a083ee2e657bd86b59c1de507cc1f19d2c4 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sun, 5 Dec 2010 00:05:05 +0000 Subject: [PATCH] BUGFIX: Don't include web.config in the assets tracked in the File table. MINOR: Add documentation to File::$allowed_extensions explaining that there are config files to edit in assets/ (from r112961) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114496 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/File.php | 9 +++++++++ filesystem/Folder.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/filesystem/File.php b/filesystem/File.php index 809ff6a19..1a3eba568 100755 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -98,6 +98,15 @@ class File extends DataObject { /** * @var array List of allowed file extensions, enforced through {@link validate()}. + * + * Note: if you modify this, you should also change a configuration file in the assets directory. + * Otherwise, the files will be able to be uploaded but they won't be able to be served by the + * webserver. + * + * - If you are running Apahce you will need to change assets/.htaccess + * - If you are running IIS you will need to change assets/web.config + * + * Instructions for the change you need to make are included in a comment in the config file. */ public static $allowed_extensions = array( '','html','htm','xhtml','js','css', diff --git a/filesystem/Folder.php b/filesystem/Folder.php index aa6216fcb..0334f819a 100755 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -118,7 +118,7 @@ class Folder extends File { if(file_exists($baseDir)) { $actualChildren = scandir($baseDir); foreach($actualChildren as $actualChild) { - if($actualChild[0] == '.' || $actualChild[0] == '_' || substr($actualChild,0,6) == 'Thumbs') { + if($actualChild[0] == '.' || $actualChild[0] == '_' || substr($actualChild,0,6) == 'Thumbs' || $actualChild == 'web.config') { continue; }