HTML_Page2 (CVS v1.9) bug found

From: Date: Sat, 24 Jul 2004 01:54:35 +0000
Subject: HTML_Page2 (CVS v1.9) bug found
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13836@lists.php.net to get a copy of this message
I'll be submitting a bug report right after this but thought I'd mention it here anyways... There's a bug in HTML_Page2/Page2.php. Line 579 (of CVS version 1.9) adds onto the variable $strHtml. The problem is the block of code immediately before it. If we're not using a frameset then $strHtml never gets initialized.
       if ($this->_doctype['variant'] == 'frameset') {
           $this->_tabOffset++;
           $tabs = $this->_getTabs();
           $strHtml = $tabs . '<noframes>' . $lnEnd;
           $this->_tabOffset++;
           $tabs = $this->_getTabs();
       }
              if ($strAttr) {
           $strHtml .= $tabs . "<body $strAttr>" . $lnEnd;
       } else {
           $strHtml .= $tabs . '<body>' . $lnEnd;
       }
This is easy enough to fix by adding an "else" statement to the first block making it ...
       if ($this->_doctype['variant'] == 'frameset') {
           $this->_tabOffset++;
           $tabs = $this->_getTabs();
           $strHtml = $tabs . '<noframes>' . $lnEnd;
           $this->_tabOffset++;
           $tabs = $this->_getTabs();
       } else {
           $strHtml = '';
} -- matte - matte@arubanetworks.com webmonkey / arubanetworks.com / airheads04.com / wi-fi-it.com

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