From 07c44d2113ee2fe67d6bdaf0018b321b1a6ebc9f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 19 Dec 2016 22:27:13 -0500 Subject: Avoid code duplication in PR #2891 --- app/functions.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/functions.php') diff --git a/app/functions.php b/app/functions.php index 9dd054fb..7cd59c41 100644 --- a/app/functions.php +++ b/app/functions.php @@ -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 * -- cgit v1.2.3