-
-
Notifications
You must be signed in to change notification settings - Fork 17
Render exception class PHPDoc description in HTML debug output #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vjik
merged 18 commits into
yiisoft:master
from
dbuhonov:feature/104-render-exception-description
Mar 21, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8918890
Render exception class PHPDoc description in HTML debug output
dbuhonov 23ae325
Escape unsafe links in exception class PHPDoc descriptions rendered i…
dbuhonov 86d6226
Apply PHP CS Fixer and Rector changes (CI)
dbuhonov 70bd017
Add tests for rendering exception PHPDoc descriptions and unsafe cont…
dbuhonov 4a102aa
Merge remote-tracking branch 'fork/feature/104-render-exception-descr…
dbuhonov 2aa9e7e
Update throwable description handling to produce HTML fragments for e…
dbuhonov 1e978c3
Add tests for escaping unsafe content in exception PHPDoc description…
dbuhonov 82446ae
Improve verbose error rendering by adding solution and original excep…
dbuhonov 9e3d0d8
Keep original throwable for templates, prepare separate displayThrowa…
dbuhonov aa1cb98
Apply PHP CS Fixer and Rector changes (CI)
dbuhonov 7bd6931
Apply PHP CS Fixer and Rector changes (CI)
samdark 71bfa0c
Potential fix for pull request finding
dbuhonov 4a941b7
Normalize throwable description handling to ensure safe markdown-to-H…
dbuhonov c4c6883
Handle safe markdown links with query parameters in throwable descrip…
dbuhonov 91cccef
Add test for handling parentheses in markdown links within throwable …
dbuhonov 5822909
Add test for handling parentheses in markdown links in exception PHPD…
dbuhonov 0ece04b
Add test for handling parentheses in markdown links in exception PHPD…
dbuhonov cf005fd
Render exception class PHPDoc description with safe markdown links in…
dbuhonov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getThrowableDescription()tokenizes markdown links with regexes that stop link targets at the first)(\((?<target>[^)]+)\)/\([^)]+\)). This will truncate and mis-render otherwise valid HTTP(S) URLs containing parentheses (common in docs, e.g. Wikipedia links), producing broken links/odd leftover text in the rendered description. Consider replacing the regex-based markdown tokenization with a more robust parser (e.g. rely on the markdown parser’s link parsing and then sanitize the produced<a>tags/hrefschemes), or implement balanced-parentheses handling for link targets so)inside URLs doesn’t break rendering.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked it and couldnt reproduce this for safe HTTP(S) URLs with parentheses. I added coverage for that in HtmlRendererTest::testVerboseOutputRendersThrowableDescriptionLinksWithParentheses.
Since the reported safe-link case is not actually broken here, I prefer not to expand this PR with changes.