]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
IE7 does not like empty img width/height
authorcash <cash.costello@gmail.com>
Fri, 8 Mar 2013 18:59:46 +0000 (13:59 -0500)
committercash <cash.costello@gmail.com>
Fri, 8 Mar 2013 18:59:46 +0000 (13:59 -0500)
views/default/icon/default.php

index 25175b0f4923641977362a3e5c0e72e356f42ee5..7f13a11894e9f98ddb43dcf8f7807fe4c852b23b 100644 (file)
@@ -44,13 +44,24 @@ if (!isset($vars['height'])) {
        $vars['height'] = $size != 'master' ? $icon_sizes[$size]['h'] : null;
 }
 
-$img = elgg_view('output/img', array(
+$img_params = array(
        'src' => $entity->getIconURL($vars['size']),
-       'alt' => $title,
-       'class' => $class,
-       'width' => $vars['width'],
-       'height' => $vars['height'],
-));
+       'alt' => $title,        
+);
+
+if (!empty($class)) {
+       $img_params['class'] = $class;
+}
+
+if (!empty($vars['width'])) {
+       $img_params['width'] = $vars['width'];
+}
+
+if (!empty($vars['height'])) {
+       $img_params['height'] = $vars['height'];
+}
+
+$img = elgg_view('output/img', $img_params);
 
 if ($url) {
        $params = array(