Skip to content

Commit

Permalink
Fix: Thumbnail is not showing in admin_browse
Browse files Browse the repository at this point in the history
When we upload image using attachment, the thumbnail is not showing
in admin_browse, because the $mimeType['1'] var is overwritten by
$mimeType['0'] and the if condition becomes false.

Closes #738
Modified-By: rchavik
  • Loading branch information
elbakai authored and rchavik committed Jan 12, 2016
1 parent cc9b677 commit 4a1602d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions FileManager/View/Attachments/admin_browse.ctp
Expand Up @@ -41,11 +41,9 @@
'editor' => 1,
), array('icon' => $this->Theme->getIcon('delete'), 'tooltip' => __d('croogo', 'Delete')), __d('croogo', 'Are you sure?'));

$mimeType = explode('/', $attachment['Attachment']['mime_type']);
$mimeType = $mimeType['0'];
$imageType = $mimeType[1];
list($mimeType, $mimeSubtype) = explode('/', $attachment['Attachment']['mime_type']);
$imagecreatefrom = array('gif', 'jpeg', 'png', 'string', 'wbmp', 'webp', 'xbm', 'xpm');
if ($mimeType == 'image' && in_array($imageType, $imagecreatefrom)) {
if ($mimeType == 'image' && in_array($mimeSubtype, $imagecreatefrom)) {
$thumbnail = $this->Html->link($this->Image->resize($attachment['Attachment']['path'], 100, 200), $attachment['Attachment']['path'], array(
'class' => 'thickbox',
'escape' => false,
Expand Down

0 comments on commit 4a1602d

Please sign in to comment.