mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Enforcing extension-less file validation (fixes #1767)
By default, File.allowed_extensions contains '' (no extension), but if you specifically remove it, the validation should pick it up.
This commit is contained in:
parent
a7574f0450
commit
2523dfbe95
@ -872,7 +872,7 @@ class File extends DataObject {
|
||||
// TODO Merge this with Upload_Validator
|
||||
$extension = $this->getExtension();
|
||||
$allowed = array_map('strtolower', $this->config()->allowed_extensions);
|
||||
if($extension && !in_array(strtolower($extension), $allowed)) {
|
||||
if(!in_array(strtolower($extension), $allowed)) {
|
||||
$exts = $allowed;
|
||||
sort($exts);
|
||||
$message = sprintf(
|
||||
|
Loading…
Reference in New Issue
Block a user