"@" will close any php errors that the function may cause. never use it
solutions:
1- Delete the escapeshellarg line from the disable_functions file in the php.ini file
2- Ask your host provider to delete the Delete escapeshellarg line from the disable_functions file in the php.ini file if you do not have access to the php.ini file
3 - make your own escapeshellarg. The function only escapes any single quotes in a given string, and then adds single quotes around it.
function my_escapeshellarg($input) { $input = str_replace('\'', '\\\'', $input); return '\''.$input.'\''; }
and follow these steps:
//$cmd = 'file --brief --mime ' . escapeshellarg($file['tmp_name']) . ' 2>&1'; $cmd = 'file --brief --mime ' . $this->my_escapeshellarg($file['tmp_name']) . ' 2>&1';
But itβs best to expand the Upload.php library and redirect the _file_mime_type function instead of changing it in the CodeIgniter core so that you donβt lose it if you want to update CodeIgniter
Waqleh
source share