note 40949 deleted from function.mime-content-type by tomsommer
| From: | tomsommer@php.net | Date: | Sun, 08 Aug 2004 08:50:18 +0000 |
| Subject: | note 40949 deleted from function.mime-content-type by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74200@lists.php.net to get a copy of this message | ||
Note Submitter: ibaldo@esquemas.com
----
Not escaping things used on shell commands is a potential security breach, the function should be
rewriten like this:
<?
if (!function_exists ("mime_content_type")) {
function mime_content_type ($file) {
return exec ("file -bi " . escapeshellcmd($file));
}
}
?>