Closed Neurergus closed 14 years ago
Using the unstable version, the _upload function adds the error to the validator object, but doesn't stop the file from being saved.
_upload
See this code:
[...] // Check to see if it's a valid type if ($this->types AND ! Upload::type($file, $this->types)) { $array->error($field, 'Upload::type'); } // Sanitize the filename $file['name'] = preg_replace('/[^a-z0-9-\.]/', '-', strtolower($file['name'])); // Strip multiple dashes $file['name'] = preg_replace('/-{2,}/', '-', $file['name']); // Upload a file? if (FALSE !== ($filename = Upload::save($file, NULL, $this->path))) { [...]
I think there should be a return after adding the error:
return
if ($this->types AND ! Upload::type($file, $this->types)) { $array->error($field, 'Upload::type'); return; }
Closed by fa7e49a1635ab8fb8b1325d36c565bbb137fe858. Thanks Cataphractus!
Using the unstable version, the
_upload
function adds the error to the validator object, but doesn't stop the file from being saved.See this code:
I think there should be a
return
after adding the error: