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

Use single quotes for auth test html attrs #206

Closed
wants to merge 1 commit into from
Closed

Use single quotes for auth test html attrs #206

wants to merge 1 commit into from

Conversation

chee
Copy link
Contributor

@chee chee commented May 21, 2021

should fix #204, close #201 and fix #188 and close #158

@pfefferle
Copy link
Member

Can you explain why the quotes are causing this issue?

@dshanske
Copy link
Member

I thought I might have messed up the sanitizing when I did that PR... might switch to using built in WordPress functions as I did elsewhere.

@chee
Copy link
Contributor Author

chee commented May 21, 2021

@pfefferle Yes, sorry: the quotes are causing the issue because when this is output it is inside JSON.
I mentioned it here: #204 (comment)

the returned response has a div with a class, and uses the double quote. so the json is invalid:

  {"message":"<div class="notice notice-success"><p>Authorization Header Found. You should be able to use all clients."}

the double quote becomes a closing quote for the message property's value

should fix #204, close #201 and fix #188

the quotes were causing the error because this string is output in JSON.
the parser interprets the opening quote of the attribute value as the closing
quote of the "message" property's value, and rather than throw an error php
returns a jolly `null`

{"message":"<div class="notice notice-success"><p>Authorization Header
  ^
@chee
Copy link
Contributor Author

chee commented May 23, 2021

i've added that info to the commit message:)

@dshanske dshanske mentioned this pull request May 25, 2021
@dshanske
Copy link
Member

Closed as implemented using esc_html

@dshanske dshanske closed this May 29, 2021
@chee chee deleted the patch-1 branch May 29, 2021 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants