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

Bug #13314 Notice error raised on parsing string
Submitted: 2008-03-05 13:03 UTC
From: farell Assigned: farell
Status: Closed Package: HTML_CSS (version 1.5.0)
PHP Version: 5.2.5 OS:
Roadmaps: 1.5.1    
Subscription  


 [2008-03-05 13:03 UTC] farell (Laurent Laville)
Description: ------------ When parsing a string with At-Rules, a notice error is raised at line 1836. Test script: --------------- <?php require_once 'HTML/CSS.php'; $css = new HTML_CSS(); $strcss = <<<EOD @media screen { color: green; background-color: yellow; } @media print { blockquote { font-size: 16pt; font-weight: bold; } } html { height: 100%; } @page thin:first { size: 3in 8in } @font-face { font-family: dreamy; font-weight: bold; src: url(http://www.example.com/font.eot); } EOD; $css->parseString($strcss); $cssData = $css->toArray(); var_export($cssData); ?> Expected result: ---------------- No error raised Actual result: -------------- Notice: Undefined offset: 1 in [...]\HTML\CSS.php on line 1836

Comments

 [2008-03-05 13:26 UTC] farell (Laurent Laville)
This notice error is raised only for @font-face At-Rule. This is a special case, because all At-rules expect to have an argument such as for : @media screen <-- screen is the argument but @font-face does not require an argument. Simple fix found to avoid $arguments to be unfilled (and with wrong data) => See CVS commit on revision 1.76