Browse Source

Values that test as "empty" should actually be displayed in some cases. For now, using === intentionally, as isset() is always true due to how the values are passed around, so we have to actually test the contents of the values.

pdontthink 18 năm trước cách đây
mục cha
commit
6f8024123d
1 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 5
      templates/default/image.tpl

+ 5 - 5
templates/default/image.tpl

@@ -55,12 +55,12 @@ if (!empty($id)) echo ' id="' . $id . '"';
 if (!empty($alt)) echo ' alt="' . $alt . '"';
 if (!empty($title)) echo ' title="' . $title . '"';
 if (!empty($onclick)) echo ' onclick="' . $onclick . '"';
-if (!empty($width)) echo ' width="' . $width . '"';
-if (!empty($height)) echo ' height="' . $height . '"';
+if (!empty($width) || $width === '0') echo ' width="' . $width . '"';
+if (!empty($height) || $height === '0') echo ' height="' . $height . '"';
 if (!empty($align)) echo ' align="' . $align . '"';
-if (!empty($border)) echo ' border="' . $border . '"';
-if (!empty($hspace)) echo ' hspace="' . $hspace . '"';
-if (!empty($vspace)) echo ' vspace="' . $vspace . '"';
+if (!empty($border) || $border === '0') echo ' border="' . $border . '"';
+if (!empty($hspace) || $hspace === '0') echo ' hspace="' . $hspace . '"';
+if (!empty($vspace) || $vspace === '0') echo ' vspace="' . $vspace . '"';
 foreach ($aAttribs as $key => $value) {
     echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
 }