Skip to content

handle invalid encoding in the pure ruby version of CGI.escapeHTML and CGI.unescapeHTML #2

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

Closed
wants to merge 1 commit into from

Conversation

ahorek
Copy link
Contributor

@ahorek ahorek commented Mar 13, 2020

the pure ruby version should behave the same way as the native extension

spec ruby/spec#759 and ruby/spec#782

note that the failure can be observed only in case when the native extension can't be loaded or with alternative ruby implementations

@ahorek ahorek changed the title handle invalid encoding in the pure ruby version of CGI.escapeHTML handle invalid encoding in the pure ruby version of CGI.escapeHTML and CGI.unescapeHTML Jul 29, 2020
@jeremyevans
Copy link
Contributor

Can you please add a test that fails with the current code and is fixed by your changes?

@ahorek
Copy link
Contributor Author

ahorek commented Aug 28, 2020

tests for both cases are in the description. It's still valid.

@jeremyevans
Copy link
Contributor

You can write a test that in a setup block aliases CGI::Escape#escapeHTML to something else and removes the method, runs the test, and then aliases it back in a teardown block (skipping the test suite if CGI::Escape#escapeHTML is not defined). This will allow you to test the pure-ruby version while the extension is installed.

Can you please add such a test so we can ensure ongoing automated tests of the pure ruby version?

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.

2 participants