Skip to content

Stop Using Deprecated URI.escape (again) - #48556

Merged
Hamms merged 3 commits into
stagingfrom
stop-using-URI.escape-again
Oct 13, 2022
Merged

Stop Using Deprecated URI.escape (again)#48556
Hamms merged 3 commits into
stagingfrom
stop-using-URI.escape-again

Conversation

@Hamms

@Hamms Hamms commented Oct 11, 2022

Copy link
Copy Markdown
Contributor

Follow-up to #46810, reapplying #46601.

Specifically, I applied all the same changes as in the original PR, but I used ERB::Util.url_encode rather than CGI.escape to encode the URL string values that got messed up last time.

Testing story

Verified that I repro the original issue on my local environment, and verified that this change fixes it.

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@Hamms Hamms added the Ruby Update Everything related to work to update the version of Ruby our codebase runs on label Oct 11, 2022
@Hamms Hamms changed the title Stop using uri.escape again Stop Using Depreacted URI.escape (again) Oct 11, 2022
@Hamms
Hamms requested a review from a team October 11, 2022 19:55
@Hamms Hamms changed the title Stop Using Depreacted URI.escape (again) Stop Using Deprecated URI.escape (again) Oct 11, 2022
@Hamms
Hamms marked this pull request as draft October 12, 2022 18:14
@Hamms
Hamms marked this pull request as ready for review October 13, 2022 04:24
@Hamms
Hamms merged commit 0587057 into staging Oct 13, 2022
@Hamms
Hamms deleted the stop-using-URI.escape-again branch October 13, 2022 20:56
Hamms added a commit that referenced this pull request Jan 3, 2023
> Identifies places where `URI.escape` can be replaced by `CGI.escape`, `URI.encode_www_form`, or `URI.encode_www_form_component` depending on your specific use case. Also this cop identifies places where `URI.unescape` can be replaced by `CGI.unescape`, `URI.decode_www_form`, or `URI.decode_www_form_component` depending on your specific use case.

Most of the required changes were already applied in #48556 and #49140 (before I know this rule existed), but the linter caught a couple that my manual searches missed.

- https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/UriEscapeUnescape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ruby Update Everything related to work to update the version of Ruby our codebase runs on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants