-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
4d41134
to
f49740a
Compare
f49740a
to
8554f73
Compare
lib/rexml/document.rb
Outdated
raise "number of entity expansions exceeded, processing aborted." | ||
end | ||
end | ||
|
||
def entity_expansion_limit=( limit ) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
- https://github.com/naitoh/rexml/blob/baeec861d8687c1a6ddc86a699347048348ce896/lib/rexml/text.rb#L271-L272
entity_expansion_text_limit =
document&.entity_expansion_text_limit || Security.entity_expansion_text_limit - https://github.com/naitoh/rexml/blob/baeec861d8687c1a6ddc86a699347048348ce896/lib/rexml/attribute.rb#L152-L154
entity_expansion_text_limit =
@element&.document&.entity_expansion_text_limit ||
Security.entity_expansion_text_limit - https://github.com/naitoh/rexml/blob/baeec861d8687c1a6ddc86a699347048348ce896/lib/rexml/entity.rb#L78-L79
entity_expansion_text_limit =
document&.entity_expansion_text_limit || Security.entity_expansion_text_limit
8554f73
to
baeec86
Compare
## Why? See: ruby#192 --------- Co-authored-by: Sutou Kouhei <[email protected]>
## Why? See: ruby#192 --------- Co-authored-by: Sutou Kouhei <[email protected]>
baeec86
to
d732ec2
Compare
Thanks. |
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=