mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Merge pull request #202 from creative-commoners/pulls/2.0/escape-file-execution
FIX Escape file path before loading file from filesystem
This commit is contained in:
commit
bcf2ac9757
@ -82,6 +82,7 @@ class DMSDocument_Controller extends Controller
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mime = finfo_file($finfo, $path);
|
||||
} elseif (is_executable($fileBin)) {
|
||||
$path = escapeshellarg($path);
|
||||
// try to use the system tool
|
||||
$mime = `$fileBin -i -b $path`;
|
||||
$mime = explode(';', $mime);
|
||||
|
Loading…
Reference in New Issue
Block a user