Smash multiple extensions down into a single one when accepting file

uploads.  Fixes #1872.
This commit is contained in:
Bharat Mediratta
2012-05-17 20:25:27 -07:00
parent 931da5f2ff
commit 9e2ea2ffed
6 changed files with 42 additions and 2 deletions

View File

@@ -98,6 +98,7 @@ class Admin_Watermarks_Controller extends Admin_Controller {
$pathinfo = pathinfo($file);
// Forge prefixes files with "uploadfile-xxxxxxx" for uniqueness
$name = preg_replace("/uploadfile-[^-]+-(.*)/", '$1', $pathinfo["basename"]);
$name = legal_file::smash_extensions($name);
if (!($image_info = getimagesize($file)) ||
!in_array($image_info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG))) {