redactor - Image security in redactorjs editor -


there security settings perform check if picture, when user uploads picture.

function is_image($image_path) { if (!$f = fopen($image_path, 'rb')) {     return false; }  $data = fread($f, 8); fclose($f);  // signature checking $unpacked = unpack("h12", $data); if (array_pop($unpacked) == '474946383961' || array_pop($unpacked) == '474946383761')     return "gif"; $unpacked = unpack("h4", $data); if (array_pop($unpacked) == 'ffd8') return "jpg"; $unpacked = unpack("h16", $data); if (array_pop($unpacked) == '89504e470d0a1a0a') return "png";  return false; } 

but can't understand how add code in redactorjs file check image. have added code on image-processor.php no result.
i have added code:

if (is_image($_files['file']['path']) == false){ die("not image @ all"); }; 

not sure working cause, if add movie instead of image file upload first , happens nothing! think problem server, want without being upload file?


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -