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

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)    

 [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


 [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 by the end of next Sunday (CET). If this was a problem with the 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.