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

Bug #11809 Incorrect @name usage causes fatal crash
Submitted: 2007-08-10 02:17 UTC
From: ashnazg Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.4.0)
PHP Version: 5.2.3 OS: Irrelevant
Roadmaps: 1.4.1    
Subscription  


 [2007-08-10 02:17 UTC] ashnazg (Chuck Burgess)
Description: ------------ A fatal crash results from having an @name tag that does contains the filename that contains that tag, rather than containing an actual global variable like it's supposed to be used for. This only seems to happen if the @name value is that filename... using the filename of another file in the parsed set does not trigger the crash, nor does using dummy words. Discovery of this issue was on Sourceforge Help forum - https://sourceforge.net/forum/message.php?msg_id=4457420 Test script: --------------- ############ bugfile.php ################ <?php /** * the file * * @package BugReports * @name bugfile.php */ ?> ######################################### Expected result: ---------------- Warning: incorrect usage of @name tag Actual result: -------------- Fatal error: Call to a member function getKeyword() on a non-object in /path/to/pear/PEAR/PhpDocumentor/phpDocumentor/IntermediateParser.inc on line 1537

Comments

 [2007-12-08 02:05 UTC] ashnazg (Chuck Burgess)
Looks like this issue is in ProceduralPages.inc... in setName($name), there is an unset() call. If the $name alias is the exact same value as the original filename that the @name alias is in, then it is effectively unsetting itself.
 [2007-12-08 03:43 UTC] ashnazg (Chuck Burgess)
Added a new Warning message for this scenario, which avoids the fatal crash. Committed to CVS.