modified : file writing and mysql vulnerabilities removed

This commit is contained in:
Fahad Abbas 2017-11-02 12:23:43 +05:00
parent 88eeb41e3f
commit c207197593
2 changed files with 13 additions and 3 deletions

View file

@ -136,8 +136,18 @@ switch($mode)
$config_for_mp4 = $Cbucket->configs['stay_mp4'];
$ffmpegpath = $Cbucket->configs['ffmpegpath'];
$extension = getExt( $_FILES['Filedata']['name']);
/*$raw_content_type = mime_content_type($_FILES['Filedata']['tmp_name']);
$content_type = substr($raw_content_type, 0,strpos($raw_content_type, '/'));*/
$raw_content_type = mime_content_type($_FILES['Filedata']['tmp_name']);
$content_type = substr($raw_content_type, 0,strpos($raw_content_type, '/'));
if ( $content_type != 'video') {
echo json_encode(array("status"=>"400","err"=>"Invalid Content"));
exit();
}
pex($content_type,true);
$types = strtolower(config('allowed_types'));
$supported_extensions = explode(',', $types);

View file

@ -12,7 +12,7 @@ define("PARENT_PAGE",'collections');
require 'includes/config.inc.php';
$pages->page_redir();
$c = mysql_clean($_GET['cid']);
$c = mysql_clean((int)$_GET['cid']);
$type = mysql_clean($_GET['type']);
$page = mysql_clean($_GET['page']);