Use xmlCtxtUseOptions() instead of setting ctxt->options directly (!)

We now require libxml2 version 2.9.0 or later.  That release is from
2012, so we should be okay.
parent 1d467e45
...@@ -40,7 +40,7 @@ dnl =========================================================================== ...@@ -40,7 +40,7 @@ dnl ===========================================================================
GLIB_REQUIRED=2.12.0 GLIB_REQUIRED=2.12.0
GIO_REQUIRED=2.24.0 GIO_REQUIRED=2.24.0
LIBXML_REQUIRED=2.7.0 LIBXML_REQUIRED=2.9.0
CAIRO_REQUIRED=1.2.0 CAIRO_REQUIRED=1.2.0
PANGO_REQUIRED=1.38.0 PANGO_REQUIRED=1.38.0
GDK_PIXBUF_REQUIRED=2.20 GDK_PIXBUF_REQUIRED=2.20
......
...@@ -675,20 +675,19 @@ rsvg_xinclude_handler_end (RsvgSaxHandler * self, const char *name) ...@@ -675,20 +675,19 @@ rsvg_xinclude_handler_end (RsvgSaxHandler * self, const char *name)
} }
static void static void
_rsvg_set_xml_parse_options(xmlParserCtxtPtr xml_parser, rsvg_set_xml_parse_options(xmlParserCtxtPtr xml_parser,
RsvgHandle *ctx) RsvgHandle *ctx)
{ {
xml_parser->options |= XML_PARSE_NONET; int options;
options = (XML_PARSE_NONET |
XML_PARSE_BIG_LINES);
if (ctx->priv->flags & RSVG_HANDLE_FLAG_UNLIMITED) { if (ctx->priv->flags & RSVG_HANDLE_FLAG_UNLIMITED) {
#if LIBXML_VERSION > 20632 options |= XML_PARSE_HUGE;
xml_parser->options |= XML_PARSE_HUGE;
#endif
} }
#if LIBXML_VERSION > 20800 xmlCtxtUseOptions (xml_parser, options);
xml_parser->options |= XML_PARSE_BIG_LINES;
#endif
} }
/* http://www.w3.org/TR/xinclude/ */ /* http://www.w3.org/TR/xinclude/ */
...@@ -742,7 +741,7 @@ rsvg_start_xinclude (RsvgHandle * ctx, RsvgPropertyBag * atts) ...@@ -742,7 +741,7 @@ rsvg_start_xinclude (RsvgHandle * ctx, RsvgPropertyBag * atts)
goto fallback; goto fallback;
xml_parser = xmlCreatePushParserCtxt (&rsvgSAXHandlerStruct, ctx, NULL, 0, NULL); xml_parser = xmlCreatePushParserCtxt (&rsvgSAXHandlerStruct, ctx, NULL, 0, NULL);
_rsvg_set_xml_parse_options(xml_parser, ctx); rsvg_set_xml_parse_options(xml_parser, ctx);
buffer = _rsvg_xml_input_buffer_new_from_stream (stream, NULL /* cancellable */, XML_CHAR_ENCODING_NONE, &err); buffer = _rsvg_xml_input_buffer_new_from_stream (stream, NULL /* cancellable */, XML_CHAR_ENCODING_NONE, &err);
g_object_unref (stream); g_object_unref (stream);
...@@ -1317,7 +1316,7 @@ create_xml_push_parser_ctxt (RsvgHandle *handle) ...@@ -1317,7 +1316,7 @@ create_xml_push_parser_ctxt (RsvgHandle *handle)
if (handle->priv->ctxt == NULL) { if (handle->priv->ctxt == NULL) {
handle->priv->ctxt = xmlCreatePushParserCtxt (&rsvgSAXHandlerStruct, handle, NULL, 0, handle->priv->ctxt = xmlCreatePushParserCtxt (&rsvgSAXHandlerStruct, handle, NULL, 0,
rsvg_handle_get_base_uri (handle)); rsvg_handle_get_base_uri (handle));
_rsvg_set_xml_parse_options(handle->priv->ctxt, handle); rsvg_set_xml_parse_options(handle->priv->ctxt, handle);
/* if false, external entities work, but internal ones don't. if true, internal entities /* if false, external entities work, but internal ones don't. if true, internal entities
work, but external ones don't. favor internal entities, in order to not cause a work, but external ones don't. favor internal entities, in order to not cause a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment