note 40935 deleted from function.mime-content-type by nlopess
| From: | nlopess@php.net | Date: | Wed, 24 Mar 2004 14:50:00 +0000 |
| Subject: | note 40935 deleted from function.mime-content-type by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67094@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));
}
}
?>