Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.6.5

Bug #1969 $strHtml not initialized if not using frameset doctype variant
Submitted: 2004-07-24 01:58 UTC
From: matte at silent-e dot com Assigned: thesaur
Status: Closed Package: HTML_Page2
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2004-07-24 01:58 UTC] matte at silent-e dot com
Description: ------------ 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. Reproduce code: --------------- Bad code: 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; } Fixed code: if ($this->_doctype['variant'] == 'frameset') { $this->_tabOffset++; $tabs = $this->_getTabs(); $strHtml = $tabs . '<noframes>' . $lnEnd; $this->_tabOffset++; $tabs = $this->_getTabs(); } else { $strHtml = ''; } Expected result: ---------------- no errors. :) Actual result: -------------- Notice: Undefined variable: strHtml in /path/to/PEAR/HTML/Page2.php on line 579

Comments

 [2004-07-24 10:26 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-07-24 13:29 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!