diff options
author | cash <cash.costello@gmail.com> | 2013-03-06 17:56:19 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2013-03-06 17:56:19 -0500 |
commit | da25d56fa09aeb8ee21767e60b27d854505cd8cd (patch) | |
tree | c6aa5831cd5c840d0e3828546b623c2135c3b534 /views/default/icon/default.php | |
parent | d051e788e7ded0811dd14c6b47bcbda602737539 (diff) | |
download | elgg-da25d56fa09aeb8ee21767e60b27d854505cd8cd.tar.gz elgg-da25d56fa09aeb8ee21767e60b27d854505cd8cd.tar.bz2 |
Fixes #5058 not forcing a size on an image
Diffstat (limited to 'views/default/icon/default.php')
-rw-r--r-- | views/default/icon/default.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/views/default/icon/default.php b/views/default/icon/default.php index 087c7eae9..25175b0f4 100644 --- a/views/default/icon/default.php +++ b/views/default/icon/default.php @@ -37,12 +37,19 @@ if (isset($vars['href'])) { $icon_sizes = elgg_get_config('icon_sizes'); $size = $vars['size']; +if (!isset($vars['width'])) { + $vars['width'] = $size != 'master' ? $icon_sizes[$size]['w'] : null; +} +if (!isset($vars['height'])) { + $vars['height'] = $size != 'master' ? $icon_sizes[$size]['h'] : null; +} + $img = elgg_view('output/img', array( 'src' => $entity->getIconURL($vars['size']), 'alt' => $title, 'class' => $class, - 'width' => $size != 'master' ? $icon_sizes[$size]['w'] : NULL, - 'height' => $size != 'master' ? $icon_sizes[$size]['h'] : NULL, + 'width' => $vars['width'], + 'height' => $vars['height'], )); if ($url) { |