Merge pull request #365 from HungryFeline/patch-2
Don't silently ignore invalid URLs
This commit is contained in:
commit
952594cdce
@ -142,7 +142,7 @@ abstract class DataHandlerExtension extends Extension {
|
||||
public function onDataUpload(DataUploadEvent $event) {
|
||||
global $user;
|
||||
|
||||
if($this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
|
||||
if(($supported_ext = $this->supported_ext($event->type)) && ($check_contents = $this->check_contents($event->tmpname))) {
|
||||
if(!move_upload_to_archive($event)) return;
|
||||
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
|
||||
|
||||
@ -197,6 +197,9 @@ abstract class DataHandlerExtension extends Extension {
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($supported_ext && !$check_contents){
|
||||
throw new UploadException("Invalid or corrupted file");
|
||||
}
|
||||
}
|
||||
|
||||
public function onThumbnailGeneration(ThumbnailGenerationEvent $event) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user