Bug #31363

Windows newline in annotation block throws exception

Added by Christof Rodejohann almost 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Should have
Category:
Reflection
Start date:
2011-10-27
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

If a class annotation contains Windows newline character instead of the expected UNIX version, FLOW3 will quit with an Uncaught Exception.

Because of this a fresh clone from /FLOW3/Distributions/Base.git might fail under some circumstances (Windows and git config "core.autocrlf = true"). This can be avoided with a correct git configuration, which is now documented in the wiki ( http://forge.typo3.org/projects/flow3/wiki/Installation_hints8 ). An example exception thrown by this configuration can be found here: http://pastebin.de/raw/?id=19666 and the bug under http://forge.typo3.org/issues/31087 is related to this issue.

The expected behavior is FLOW3 working with Windows new-line in annotations block.

PS: Thx to the #flow3 IRC channel and afoeder for figuring this out.


Related issues

Related to TYPO3.Flow - Bug #32466: Strange exception: Invalid annotationResolvedKarsten Dambekalns2011-12-12

Actions
#1

Updated by Christof Rodejohann almost 10 years ago

Having trouble with my git environment, so i can't push the patch. The solution is a one-line change in

Packages\Framework\TYPO3.FLOW3\Classes\Reflection\DocCommentParser.php

In Line 50, the $line has to be stripped of all newline characters. Adding the following line there will fix the bug:

$line = str_replace(array("\r\n", "\n", "\r"), "", $line);
#2

Updated by Karsten Dambekalns almost 10 years ago

  • Category set to Reflection
  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.0.2
#3

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7287

#4

Updated by Karsten Dambekalns almost 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#5

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch FLOW3-1.0 has been pushed to the review server.
It is available at http://review.typo3.org/7435

#6

Updated by Karsten Dambekalns almost 10 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF