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

Add local entity expansion limit methods #202

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

naitoh
Copy link
Contributor

@naitoh naitoh commented Aug 22, 2024

GitHub: fix GH-192

Add local entity expansion limit methods.

  • REXML::Document#entity_expansion_limit=
  • REXML::Document#entity_expansion_text_limit=
  • REXML::Parsers::SAX2Parser#entity_expansion_limit=
  • REXML::Parsers::SAX2Parser#entity_expansion_text_limit=
  • REXML::Parsers::StreamParser#entity_expansion_limit=
  • REXML::Parsers::StreamParser#entity_expansion_text_limit=
  • REXML::Parsers::PullParser#entity_expansion_limit=
  • REXML::Parsers::PullParser#entity_expansion_text_limit=

@naitoh naitoh force-pushed the add_local_entity_expansion_limit branch from 4d41134 to f49740a Compare August 22, 2024 14:27
@naitoh naitoh marked this pull request as ready for review August 22, 2024 14:36
@naitoh naitoh force-pushed the add_local_entity_expansion_limit branch from f49740a to 8554f73 Compare August 22, 2024 14:58
raise "number of entity expansions exceeded, processing aborted."
end
end

def entity_expansion_limit=( limit )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using attr_writer :entity_expansion_limit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK
I see.

@@ -431,14 +433,19 @@ def Document::entity_expansion_text_limit
end

attr_reader :entity_expansion_count
attr_accessor :entity_expansion_text_limit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the reader for this?

Copy link
Contributor Author

@naitoh naitoh Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes
In the following we use reader.

lib/rexml/attribute.rb Outdated Show resolved Hide resolved
@naitoh naitoh force-pushed the add_local_entity_expansion_limit branch from 8554f73 to baeec86 Compare August 23, 2024 12:01
@naitoh naitoh requested a review from kou August 23, 2024 12:10
lib/rexml/text.rb Outdated Show resolved Hide resolved
naitoh and others added 2 commits August 26, 2024 18:36
## Why?
See: ruby#192

---------

Co-authored-by: Sutou Kouhei <[email protected]>
@naitoh naitoh force-pushed the add_local_entity_expansion_limit branch from baeec86 to d732ec2 Compare August 26, 2024 09:38
@naitoh naitoh requested a review from kou August 26, 2024 09:44
@kou kou merged commit caec187 into ruby:master Aug 26, 2024
61 checks passed
@kou
Copy link
Member

kou commented Aug 26, 2024

Thanks.

@naitoh naitoh deleted the add_local_entity_expansion_limit branch August 26, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add local entity expansion limit to REXML::Parsers::StreamParser
4 participants