Skip to content

Commit

Permalink
Fix undefined array keys when displaying images
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Jan 27, 2021
1 parent 3fef852 commit 357c9a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inc/common.php
Expand Up @@ -587,8 +587,10 @@ function ml($id = '', $more = '', $direct = true, $sep = '&', $abs = false)

if(is_array($more)) {
// add token for resized images
if(!empty($more['w']) || !empty($more['h']) || $isexternalimage){
$more['tok'] = media_get_token($id,$more['w'],$more['h']);
$w = isset($more['w']) ? $more['w'] : null;
$h = isset($more['h']) ? $more['h'] : null;
if(!$w || !$h || $isexternalimage){
$more['tok'] = media_get_token($id, $w, $h);
}
// strip defaults for shorter URLs
if(isset($more['cache']) && $more['cache'] == 'cache') unset($more['cache']);
Expand Down

0 comments on commit 357c9a3

Please sign in to comment.