You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes a language exception, preg_match_all(): Unknown modifier ']', because the / character is used as the regular expression delimiter within the URLify library.
The above example derives from a fairly common and reasonable use-case: I want to remove all illegal characters from a file name, and on UNIX and Windows, / is illegal.
To fix this, PHP's preg_quote() function must be called on the keys in the array argument passed to add_chars().
I'll submit a PR shortly that seeks to fix the issue.
The text was updated successfully, but these errors were encountered:
cbj4074
added a commit
to cbj4074/urlify
that referenced
this issue
Feb 4, 2019
This change fixes a language exception that occurs when a character
that is used as a regular expression delimiter ("/" by default) is
included as a key in the array argument passed into the add_chars()
method, and the downcode() is called.
Note that the existing tests do not cover this scenario.
cbj4074
added a commit
to cbj4074/urlify
that referenced
this issue
Feb 4, 2019
This change fixes a language exception that occurs when a character
that is used as a regular expression delimiter ("/" by default) is
included as a key in the array argument passed into the add_chars()
method, and then downcode() is called.
Note that the existing tests do not cover this scenario.
lux
added a commit
that referenced
this issue
Jun 5, 2019
Consider the following:
This causes a language exception,
preg_match_all(): Unknown modifier ']'
, because the/
character is used as the regular expression delimiter within the URLify library.The above example derives from a fairly common and reasonable use-case: I want to remove all illegal characters from a file name, and on UNIX and Windows,
/
is illegal.To fix this, PHP's
preg_quote()
function must be called on the keys in the array argument passed toadd_chars()
.I'll submit a PR shortly that seeks to fix the issue.
The text was updated successfully, but these errors were encountered: