Skip to content
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

Argument 1 passed to RegexHelper::isEscapable() must be of the type string, null given #403

Closed
ntzm opened this issue Jan 15, 2020 · 2 comments
Assignees
Labels
bug Something isn't working right

Comments

@ntzm
Copy link
Contributor

ntzm commented Jan 15, 2020

Version(s) affected: 1.2.1

Description

When converting malformed markdown, I get a TypeError

How to reproduce

Markdown:

[](\B\
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to League\CommonMark\Util\RegexHelper::isEscapable() must be of the type string, null given, called in /home/nat/Code/personal/fuzzer-test/commonmark/vendor/league/commonmark/src/Util/LinkParserHelper.php on line 101 and defined in /home/nat/Code/personal/fuzzer-test/commonmark/vendor/league/commonmark/src/Util/RegexHelper.php:74
Stack trace:
#0 /home/nat/Code/personal/fuzzer-test/commonmark/vendor/league/commonmark/src/Util/LinkParserHelper.php(101): League\CommonMark\Util\RegexHelper::isEscapable(NULL)
#1 /home/nat/Code/personal/fuzzer-test/commonmark/vendor/league/commonmark/src/Util/LinkParserHelper.php(41): League\CommonMark\Util\LinkParserHelper::manuallyParseLinkDestination(Object(League\CommonMark\Cursor))
#2 /home/nat/Code/personal/fuzzer-test/commonmark/vendor/league/commonmark/src/Inline/Parser/CloseBracketParser.php(154): League\CommonMark\Util\LinkParserHelper::parseLinkDestination(Object(League\CommonMark\Cursor))
#3 /home/nat/Code/personal/fuzzer-test/commo in /home/nat/Code/personal/fuzzer-test/commonmark/vendor/league/commonmark/src/Util/RegexHelper.php on line 74
@GrahamCampbell
Copy link
Member

#404 should fix your issue. ;)

@colinodell
Copy link
Member

Fixed via db580f6 (thanks Graham!) and included in new releases 1.1.3 and 1.2.2.

@colinodell colinodell self-assigned this Jan 16, 2020
@colinodell colinodell added the bug Something isn't working right label Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants