From: Adam Dickmeiss Date: Mon, 19 Aug 2013 09:13:36 +0000 (+0200) Subject: Don't MARC decode XML/HTML X-Git-Tag: v4.2.64~3 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=6db306098a49682128a8e7bde44020fdf28fab62;p=yaz-moved-to-github.git Don't MARC decode XML/HTML --- diff --git a/client/client.c b/client/client.c index f354979..0147b06 100644 --- a/client/client.c +++ b/client/client.c @@ -923,7 +923,7 @@ static void display_record(Z_External *r) const char *octet_buf = (const char*)r->u.octet_aligned->buf; size_t octet_len = r->u.octet_aligned->len; if (!oid_oidcmp(oid, yaz_oid_recsyn_xml) - || !oid_oidcmp(oid, yaz_oid_recsyn_xml) + || !oid_oidcmp(oid, yaz_oid_recsyn_application_xml) || !oid_oidcmp(oid, yaz_oid_recsyn_html)) { print_xml_record(octet_buf, octet_len); diff --git a/src/record_render.c b/src/record_render.c index 6acb1d7..82da22c 100644 --- a/src/record_render.c +++ b/src/record_render.c @@ -167,16 +167,21 @@ static const char *return_record_wrbuf(WRBUF wrbuf, int *len, charset); else if (r->which == Z_External_octet) { - const char *ret_buf = return_marc_record( - wrbuf, marctype, len, - (const char *) r->u.octet_aligned->buf, - r->u.octet_aligned->len, - charset); - if (ret_buf) - return ret_buf; - /* not ISO2709. Return fail unless raw (ISO2709) is wanted */ - if (yaz_oid_is_iso2709(oid) && marctype != YAZ_MARC_ISO2709) - return 0; + if (oid_oidcmp(oid, yaz_oid_recsyn_xml) + && oid_oidcmp(oid, yaz_oid_recsyn_application_xml) + && oid_oidcmp(oid, yaz_oid_recsyn_html)) + { + const char *ret_buf = return_marc_record( + wrbuf, marctype, len, + (const char *) r->u.octet_aligned->buf, + r->u.octet_aligned->len, + charset); + if (ret_buf) + return ret_buf; + /* not ISO2709. Return fail unless raw (ISO2709) is wanted */ + if (yaz_oid_is_iso2709(oid) && marctype != YAZ_MARC_ISO2709) + return 0; + } return return_string_record(wrbuf, len, (const char *) r->u.octet_aligned->buf, r->u.octet_aligned->len,