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

Bug #11120 Uninitialized string offset in AbstractParser.php on line 200
Submitted: 2007-05-24 07:44 UTC
From: troehr Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 0.6.0)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 20 + 7 = ?

 
 [2007-05-24 07:44 UTC] troehr (Torsten Roehr)
Description: ------------ Please add a check prior to accessing the string offset. Change CodeSniffer/CommentParser/AbstractParser.php Line 200: } else if ($line{0} === '*') { to: } else if (isset($line{0}) && $line{0} === '*') { Regards, Torsten

Comments

 [2007-05-29 05:37 UTC] squiz (Greg Sherwood)
Sample code to reproduce: /** * * */ function test() {}
 [2007-05-29 05:38 UTC] squiz (Greg Sherwood)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Fixed by moving the trim() to above the check for an empty string.