Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@k0kubun
Copy link
Member

@k0kubun k0kubun commented May 13, 2025

Since https://bugs.ruby-lang.org/issues/21258, Ruby 3.5+ no longer ships cgi.gem. So we've removed the cgi.gem dependency from erb.gem #59.

This PR adds the original implementation of CGI.escapeURIComponent before #23 as a fallback in case cgi.gem v0.3.2 or older is used. The method was first added in cgi.gem v0.3.3.

This PR also bumps required_ruby_version to Ruby 3.2, which ships cgi.gem v0.3.6, to minimize the possibility of the fallback implementation used for CRuby. Note that Ruby 3.1 reached EOL on March 31st, 2025, so we're not obligated to support Ruby 3.1 or older anyway. The CI doesn't test those versions either.

I also added a comment to clarify why require 'cgi/escape' is enough for ERB::Util. erb.gem shouldn't need to require 'cgi/util', which is warned in Ruby 3.5, even for TruffleRuby.

@k0kubun k0kubun merged commit de9bb8c into ruby:master May 13, 2025
7 checks passed
@k0kubun k0kubun deleted the cgi-escape-migration branch May 13, 2025 17:50
matzbot pushed a commit to ruby/ruby that referenced this pull request May 13, 2025
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