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

@@ -210,9 +210,7 @@ abstract class FileModel extends Base
*/
public function isImage($filename)
{
$extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
switch ($extension) {
switch (get_file_extension($filename)) {
case 'jpeg':
case 'jpg':
case 'png':