Avoid code duplication in PR #2891

This commit is contained in:
Frederic Guillot
2016-12-19 22:27:13 -05:00
parent eed51aef63
commit 07c44d2113
7 changed files with 60 additions and 50 deletions

View File

@@ -145,6 +145,17 @@ function get_upload_max_size()
return min(ini_get('upload_max_filesize'), ini_get('post_max_size'));
}
/**
* Get file extension
*
* @param $filename
* @return string
*/
function get_file_extension($filename)
{
return strtolower(pathinfo($filename, PATHINFO_EXTENSION));
}
/**
* Translate a string
*