]> git.kaiwu.me - njs.git/commit
Added escaping to lone closing square brackets in a regexp.
authorAlexander Borisov <alexander.borisov@nginx.com>
Fri, 17 May 2019 14:01:10 +0000 (17:01 +0300)
committerAlexander Borisov <alexander.borisov@nginx.com>
Fri, 17 May 2019 14:01:10 +0000 (17:01 +0300)
commit0bcb290ae8e1d49b95986ae18a4a93bc84e700b8
treeb462745bfe85b80af8fa88e6646a9bf18822589a
parent8995984ade857048ee880d8b785c6b4f951ea60d
Added escaping to lone closing square brackets in a regexp.

PCRE with PCRE_JAVASCRIPT_COMPAT flag rejects regexps with
lone closing square brackets as invalid. Whereas according
to ES6: 11.8.5 it is a valid regexp expression.

As a workaround, the solution is to escape those lone brackets.

This closes #157 issue on GitHub.
njs/njs_regexp.c
njs/test/njs_unit_test.c