fixed a bug where files woul get saved even though they were not allowed by type

This commit is contained in:
Christian Haschek
2015-11-23 20:38:39 +01:00
parent 3a0cd3c004
commit 121ae8b19a

View File

@@ -308,6 +308,9 @@ class PictshareModel extends Model
{
$type = $this->getTypeOfFile($url);
$type = $this->isTypeAllowed($type);
if(!$type)
return array('status'=>'ERR','reason'=>'wrong filetype');
$dup_id = $this->isDuplicate($url);
if($dup_id)
@@ -322,8 +325,7 @@ class PictshareModel extends Model
}
if(!$type)
return array('status'=>'ERR','reason'=>'wrong filetype');
if($dup_id)
return array('status'=>'OK','type'=>$type,'hash'=>$hash,'url'=>DOMAINPATH.$hash,'domain'=>DOMAINPATH);