This commit is contained in:
Chris
2018-12-26 14:18:00 +01:00
parent 66fc8aff14
commit 5fb9d21016

View File

@@ -27,6 +27,7 @@ $url = trim($_REQUEST['url']);
if(!$url || !startsWith($url, 'http'))
exit(json_encode(array('status'=>'err','reason'=>'Invalid URL')));
//@todo: let user decide max upload size via config and set php_ini var
else if(remote_filesize($url)*0.000001 > 20)
exit(json_encode(array('status'=>'err','reason'=>'File too big. 20MB max')));
@@ -43,8 +44,6 @@ $ehash = sha1Exists($sha1);
if($ehash && file_exists(ROOT.DS.'data'.DS.$ehash.DS.$ehash))
exit(json_encode(array('status'=>'ok','hash'=>$ehash,'filetype'=>$type,'url'=>URL.$ehash)));
//cross check filetype for controllers
//
//image?