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

Change AbstractParser.php to support all Json encoded strings #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AZoumis
Copy link

@AZoumis AZoumis commented May 28, 2024

According to the RFC, (https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.2) the comparison value rules are built on JSON Data Interchange format ABNF rules. That means that a comparison value such as "test\"" should be parsed as test". However, the current implementation would not recognize this comparison value as a string.

Therefore, the following changed were made:

  1. Use a more complex regex that should recognize all JSON encoded strings (https://stackoverflow.com/questions/32155133/regex-to-match-a-json-string).
  2. Use json_decode() instead of trim() to decode a string comparison value. This fixes several issues, such as escaped quotes being trimmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant