a bug into package HTML_Table 1.5

From: Date: Sun, 08 May 2005 17:59:13 +0000
Subject: a bug into package HTML_Table 1.5
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19109@lists.php.net to get a copy of this message
Hi all, On my current project i've used recently the HTML_Table package to generate an html table. All run fine until a play more with it ! I've tried a clone of pear manual and dicovered a problem when data cell is equal to zero (integer). The zero was replaced by null string. BTW: there is a typo error in pear manual example at http://pear.php.net/manual/en/package.html.html-table.intro.php $table -> setHeaderContents(0, 1, "EMail"); should be written like that $table -> setHeaderContents(0, 4, "EMail"); Have a look at URL: http://pear.laurent-laville.org/HTML_Table/ You'll see the visual result To solve the bug, but i'm not sure it's the best solution could be to : patch HTML_Table::toHtml() method around line 583 as if (isset($this->_structure[$i][$j]["contents"])) {
      if (is_int($this->_structure[$i][$j]["contents"])) {
         $contents = strval($this->_structure[$i][$j]["contents"]);
      } else {
         $contents = $this->_structure[$i][$j]["contents"];
      }
} else {
      $contents = "";
} Tell me what you think about it regards Laurent Laville

« previous php.pear.general (#19109) next »