cvs: pear /HTML_Table package.php /HTML_Table/Table Storage.php
| From: | Mark Wiesemann | Date: | Tue, 25 Oct 2005 20:29:43 +0000 |
| Subject: | cvs: pear /HTML_Table package.php /HTML_Table/Table Storage.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35856@lists.php.net to get a copy of this message | ||
wiesemann Tue Oct 25 16:29:43 2005 EDT
Modified files:
/pear/HTML_Table package.php
/pear/HTML_Table/Table Storage.php
Log:
Bug #5782: remove PHP warning if \$contents == null in addCol()
and addRow()
http://cvs.php.net/diff.php/pear/HTML_Table/package.php?r1=1.16&r2=1.17&ty=u
Index: pear/HTML_Table/package.php
diff -u pear/HTML_Table/package.php:1.16 pear/HTML_Table/package.php:1.17
--- pear/HTML_Table/package.php:1.16 Tue Oct 25 11:25:31 2005
+++ pear/HTML_Table/package.php Tue Oct 25 16:29:38 2005
@@ -4,7 +4,7 @@
*
* Taken from PEAR::Log, thanks Jon ;)
*
- * $Id: package.php,v 1.16 2005/10/25 15:25:31 dufuz Exp $
+ * $Id: package.php,v 1.17 2005/10/25 20:29:38 wiesemann Exp $
*/
require_once 'PEAR/PackageFileManager.php';
require_once 'Console/Getopt.php';
@@ -16,6 +16,7 @@
- Bugfix: addCol() had the same problem as in request #4988 (it did not accept array keys as row
numbers)
- Bugfix: toHtml() wrongly assumed that there are instances of \$_thead and \$_tfoot when
\$useTGroups == true
- Bugfix: return PEAR_Error object in getCellContents when cell does not exist
+- Bug #5782: remove PHP warning if \$contents == null in addCol() and addRow()
- Couple of unit tests were added, covering a lot of ground.
EOT;
http://cvs.php.net/diff.php/pear/HTML_Table/Table/Storage.php?r1=1.5&r2=1.6&ty=u
Index: pear/HTML_Table/Table/Storage.php
diff -u pear/HTML_Table/Table/Storage.php:1.5 pear/HTML_Table/Table/Storage.php:1.6
--- pear/HTML_Table/Table/Storage.php:1.5 Tue Oct 25 08:56:33 2005
+++ pear/HTML_Table/Table/Storage.php Tue Oct 25 16:29:43 2005
@@ -22,7 +22,7 @@
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Storage.php,v 1.5 2005/10/25 12:56:33 wiesemann Exp $
+ * @version CVS: $Id: Storage.php,v 1.6 2005/10/25 20:29:43 wiesemann Exp $
* @link http://pear.php.net/package/HTML_Table
*/
@@ -421,6 +421,9 @@
if (isset($contents) && !is_array($contents)) {
return PEAR::raiseError('First parameter to HTML_Table::addRow must be an
array');
}
+ if (is_null($contents)) {
+ $contents = array();
+ }
$type = strtolower($type);
$row = $this->_rows++;
@@ -543,6 +546,10 @@
if (isset($contents) && !is_array($contents)) {
return PEAR::raiseError('First parameter to HTML_Table::addCol must be an
array');
}
+ if (is_null($contents)) {
+ $contents = array();
+ }
+
$type = strtolower($type);
$col = $this->_cols++;
foreach ($contents as $row => $content) {