From 25f17fdecaa895478a9b2e3e59b044ac5a0e3c4d Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 20 Nov 2016 20:06:05 +0000 Subject: Ignore http and https addresses when fetching entity refs The fopen() causes a requester on AmigaOS which I'm bored of hearing about. See also bug 2313 --- bindings/xml/expat_xmlparser.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bindings/xml/expat_xmlparser.c b/bindings/xml/expat_xmlparser.c index e5bc2e6..a63ccf1 100644 --- a/bindings/xml/expat_xmlparser.c +++ b/bindings/xml/expat_xmlparser.c @@ -319,6 +319,19 @@ expat_xmlparser_external_entity_ref_handler(XML_Parser parser, if (system_id == NULL) return XML_STATUS_OK; + /* If the ID is a network URI, return (see bug 2313 and below) */ + if ((strncmp(system_id, "http://", 7) == 0) || + (strncmp(system_id, "https://", 8) == 0)) { + return XML_STATUS_OK; + } + + /*\todo This needs fixing. Our system_id, if not + * absolute, needs to be made absolute relative to + * base before being opened. It should also be + * passed back to the client to be opened, as network + * addresses need special handling and local files + * should also have the file:// scheme, so fopen is + * not necessarily going to work. */ fh = fopen(system_id, "r"); if (fh == NULL) -- cgit v1.2.3