Any single quotes that appear in commit messages are escaped to ' in the commitlog - fine so far.
Unfortunately, whatever filter renders issue links then inserts a link to make it &<a href="/node/039">#039</a>;. Oops. This also breaks the apostrophe entity.
I'm not sure what the best approach is, here - clearly the markup does need to be escaped before the links are added, and check_plain() uses ENT_QUOTES.
Adding (?<!&) to the regex pattern would make it not match #\d* preceded by an ampersand.
Alternatively, adding ENT_HTML5 to core's check_plain() (which was added in PHP 5.4, and might make sense) would avoid the numerical entity and make it print '.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | versioncontrol.2474005-apostrophe-issue-link.patch | 820 bytes | cburschka |
Comments
Comment #1
cburschkaComment #2
cburschkaAddendum: Never mind the ENT_HTML5, I was stuck on D8. Obviously, D7 core can't use PHP 5.4 features yet.
Comment #3
cburschkaI haven't taken the time to set up a test environment for this module, but the regex seems to do what it should.
Comment #4
cburschkaMoving to #2392847: HTML entities prevalent on git log pages.