PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_Table » Bug #786

Incorrect Handling of zero value integer

Details

Submitted2004-02-18 15:30 UTC
Fromb dot m dot d dot scott_NO_SPAM at herts dot ac dot uk
Assignedmansion
StatusClosed
PackageHTML_Table
PHP Version4.3.4
OSWindows XP
Roadmaps(Not assigned)

Comments

[2004-02-18 15:30 UTC] b dot m dot d dot scott_NO_SPAM at herts dot ac dot uk

Description:
------------
If you attempt to add an integer with value 0 to a row it is replaced by the autofill value.
I think that if you change:
if (isset($this->_autoFill) && $contents == "") {
$contents = $this->_autoFill;
}
To:
if (isset($this->_autoFill) && $contents === "") {
$contents = $this->_autoFill;
}
in the toHtml function that it will work.

Reproduce code:
---------------
require_once 'HTML/Table.php';
$table= new HTML_table();
$table->addRow(array(1,0,1));
print $table->toHTML();

Expected result:
----------------
<table>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
</table>

Actual result:
--------------
<table>
<tr>
<td>1</td>
<td> </td>
<td>1</td>
</tr>
</table>

[2004-07-07 16:22 UTC] bmansion at mamasam dot com

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.