-
Notifications
You must be signed in to change notification settings - Fork 356
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
Bug: Unescaped slash throws error, when pattern contains slash #649
Comments
Thanks for reporting this. A PR that fixes it would be very welcome 🙂. |
would you consider to file a PR on this? @a-r-m-i-n |
Just asking, as I may also pick a take on it. For that I would be also interested in the "throws error" details, specifically how to provoke an error and what message of that error mentioned is. /cc @a-r-m-i-n The |
Here we go. I just copied the preg_match from the second place. If you want to replace the used function, feel free. I think this will at least solve the issue I currently have, when I try to use Composer's JSON schema. The "name" property there, got a check pattern for "abc/def", including the unescaped / which is also used as delimiter before. |
That method uses |
Thanks! |
Here you don't escape slashes in expression: https://github.com/justinrainbow/json-schema/blob/fa4d2d3c1e40a222ded125b679891086c9a6c7d6/src/JsonSchema/Constraints/FormatConstraint.php#L200
Here you do: https://github.com/justinrainbow/json-schema/blob/fa4d2d3c1e40a222ded125b679891086c9a6c7d6/src/JsonSchema/Constraints/StringConstraint.php#L43
The first check should do the same here.
Thanks for this great lib! And a happy new year! 🥳
The text was updated successfully, but these errors were encountered: