Skip to content

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

Open
AZoumis wants to merge 1 commit into
Cloudstek:masterfrom
AZoumis:master
Open

Change AbstractParser.php to support all Json encoded strings#5
AZoumis wants to merge 1 commit into
Cloudstek:masterfrom
AZoumis:master

Conversation

@AZoumis
Copy link
Copy Markdown

@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