Update CID to v1.3.1#21
Merged
cyberpower678 merged 3 commits intowikimedia:masterfrom Aug 18, 2017
Merged
Conversation
This update makes the following changes: *Pluses in the paths are not forcibly encoded to %2B. They are legal characters in URLs *Pluses in the queries are not forcibly encoded to %2B as %2B means a literal plus, and the plus means a space. *The idiot proof check now uses a sanity check to ensure the URL is fully encoded to prevent accidental decoding of double URLs. Tests: *Added URL http://www.musicvf.com/Buck+Owens+%2526+Ringo+Starr.art which came back dead with the algorithm. *Added same URL to the sanitizing test to test new sanity check *Removed a couple of now useless tests, where URLs returned are identical to the input.
Fix code sniffer complaints.
Collaborator
Author
|
Just a friendly bump. I would like to deploy this update before I launch a critical update to IABot. |
kaldari
requested changes
Aug 16, 2017
| // Reattach the fragment | ||
| if ( !is_null( $fragment ) ) { | ||
| $url .= "#$fragment"; | ||
| // Make sure URL is fully encoded by checking if the :// is encoded. |
Collaborator
There was a problem hiding this comment.
This comment is confusing. It makes it sound like we expect all URLs passed to parseURL() to be URL-encoded. I imagine you mean to say something like "See if the URL is fully encoded by checking if the :// is encoded."
Collaborator
Author
There was a problem hiding this comment.
This is an existing comment.
| // This avoids possible 400 Bad Response errors. | ||
| $url .= "/"; | ||
| if ( isset( $parts['path'] ) && strlen( $parts['path'] ) > 1 ) { | ||
| $parts['path'] = str_replace( "+", "CHECKIFDEADPLUSSPACE", $parts['path'] ); |
Collaborator
There was a problem hiding this comment.
Can you add a comment explaining why we need to worry about pluses in the path (and possibly add an example URL)?
Collaborator
Author
There was a problem hiding this comment.
I can add the comment but the URL is already in the test cases I modified.
Add comments per request of reviewer.
Collaborator
Author
|
@kaldari I made the requested changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This update makes the following changes:
*Pluses in the paths are not forcibly encoded to %2B. They are legal
characters in URLs
*Pluses in the queries are not forcibly encoded to %2B as %2B means a
literal plus, and the plus means a space.
*The idiot proof check now uses a sanity check to ensure the URL is
fully encoded to prevent accidental decoding of double URLs.
Tests:
*Added URL http://www.musicvf.com/Buck+Owens+%2526+Ringo+Starr.art
which came back dead with the algorithm.
*Added same URL to the sanitizing test to test new sanity check
*Removed a couple of now useless tests, where URLs returned are
identical to the input.