mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-17 00:04:18 +00:00
fix(xfa): initialize merged-packet parsing options completely
This commit is contained in:
1 file changed
+2
-2
@@ -117,7 +117,7 @@ fn merge(text: &str, within: Within, op: Op, warnings: &mut Vec<String>) -> Merg
|
||||
warnings.push("The XFA data nests XML elements deeper than the reader accepts; the field values were not written to it".into());
|
||||
return Merged::Failed;
|
||||
}
|
||||
let opts = || crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES, ..Default::default() };
|
||||
let opts = || crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES };
|
||||
// A packet of an array may use the prefixes the XDP envelope declares: read it inside
|
||||
// an element declaring the usual ones.
|
||||
let wrapped;
|
||||
@@ -465,7 +465,7 @@ pub(super) fn readable(text: &str, within: Within, warnings: &mut Vec<String>) -
|
||||
warnings.push(format!("The XFA data would be larger than {} MB; it was not written", MAX_PACKET_WRITE >> 20));
|
||||
return false;
|
||||
}
|
||||
let opts = || crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES, ..Default::default() };
|
||||
let opts = || crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES };
|
||||
let ok = crate::xml::Document::parse_with_options(text, opts()).is_ok()
|
||||
|| (within == Within::Packet && crate::xml::Document::parse_with_options(&format!("{WRAP_OPEN}{text}{WRAP_CLOSE}"), opts()).is_ok());
|
||||
if !ok {
|
||||
|
||||
Reference in new issue
Block a user