1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

Auto fix extension parameter (allow disable auto-rename)

This commit is contained in:
SecretR
2014-08-19 14:03:42 +03:00
parent f9111fd5ca
commit b293dc71ef

View File

@@ -304,9 +304,10 @@ class e_file
* Collect file information
* @param string $path_to_file
* @param boolean $imgcheck
* @param boolean $auto_fix_ext
* @return array
*/
function get_file_info($path_to_file, $imgcheck = true)
function get_file_info($path_to_file, $imgcheck = true, $auto_fix_ext = true)
{
$finfo = array();
@@ -329,6 +330,8 @@ class e_file
}
if($auto_fix_ext)
{
// Auto-Fix Files without an extensions using known mime-type.
if(empty($finfo['pathinfo']['extension']) && !is_dir($path_to_file) && !empty($finfo['mime']))
{
@@ -348,6 +351,7 @@ class e_file
}
}
}
}
if($imgcheck && ($tmp = getimagesize($path_to_file)))