mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-16 04:58:00 +00:00
checking for upload code if requred by config
This commit is contained in:
@@ -318,13 +318,16 @@ class PictshareModel extends Model
|
|||||||
|
|
||||||
function processSingleUpload($file,$name)
|
function processSingleUpload($file,$name)
|
||||||
{
|
{
|
||||||
if(UPLOAD_CODE!=false && !$pm->uploadCodeExists($_REQUEST['upload_code']))
|
if(UPLOAD_CODE && !$pm->uploadCodeExists($_REQUEST['upload_code']))
|
||||||
exit(json_encode(array('status'=>'ERR','reason'=>'Wrong upload code provided')));
|
exit(json_encode(array('status'=>'ERR','reason'=>$this->translate(21))));
|
||||||
|
|
||||||
$im = new Image();
|
$im = new Image();
|
||||||
$i = 0;
|
|
||||||
if ($_FILES[$name]["error"] == UPLOAD_ERR_OK)
|
if ($_FILES[$name]["error"] == UPLOAD_ERR_OK)
|
||||||
{
|
{
|
||||||
|
$type = $this->getTypeOfFile($_FILES[$name]["tmp_name"]);
|
||||||
|
$type = $this->isTypeAllowed($type);
|
||||||
|
if(!$type) exit(json_encode(array('status'=>'ERR','reason'=>'Unsupported type')));
|
||||||
|
|
||||||
$data = $this->uploadImageFromURL($_FILES[$name]["tmp_name"]);
|
$data = $this->uploadImageFromURL($_FILES[$name]["tmp_name"]);
|
||||||
if($data['status']=='OK')
|
if($data['status']=='OK')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user