diff options
Diffstat (limited to 'src/xml/repr-io.cpp')
| -rw-r--r-- | src/xml/repr-io.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index ae6f238d4..d8e0f5418 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -404,7 +404,12 @@ Document *sp_repr_read_mem (const gchar * buffer, gint length, const gchar *defa g_return_val_if_fail (buffer != NULL, NULL); - doc = xmlParseMemory (const_cast<gchar *>(buffer), length); + int parser_options = XML_PARSE_HUGE | XML_PARSE_RECOVER; + parser_options |= XML_PARSE_NONET; // TODO: should we allow network access? + // proper solution would be to check the preference "/options/externalresources/xml/allow_net_access" + // as done in XmlSource::readXml which gets called by the analogous sp_repr_read_file() + // but sp_repr_read_mem() seems to be called in locations where Inkscape::Preferences::get() fails badly + doc = xmlReadMemory (const_cast<gchar *>(buffer), length, NULL, NULL, parser_options); rdoc = sp_repr_do_read (doc, default_ns); if (doc) { |
