Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hardik-codes committed Mar 29, 2019
1 parent 5d85b08 commit 93f5b2a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/fields/media/tmpl/media.php
Expand Up @@ -29,11 +29,16 @@
{
continue;
}

if(substr($path, -4) == '.pdf')
{
$file = explode('/', $path);
$buffer = '<a href="'. $path .'" target="_blank" rel="noopener">'. end($file) .'</a>';
} else {
$buffer .= sprintf('<img src="%s"%s>',
htmlentities($path, ENT_COMPAT, 'UTF-8', true),
$class
);
);
}
}

echo $buffer;

0 comments on commit 93f5b2a

Please sign in to comment.