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:
Ingo Schommer 2013-04-17 10:21:49 +02:00
parent a7574f0450
commit 2523dfbe95

View File

@ -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(