From 31ef7748845ab6f07a5f2fec4f35747470c47583 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Mon, 27 Nov 2017 14:34:09 +0000 Subject: [PATCH] The other half of r1442409: fix mod_proxy_html doctype-handling typos PR 56457 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1816458 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_proxy_html.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/modules/filters/mod_proxy_html.c b/modules/filters/mod_proxy_html.c index 743f143780..fc28b278d9 100644 --- a/modules/filters/mod_proxy_html.c +++ b/modules/filters/mod_proxy_html.c @@ -401,28 +401,22 @@ static void pstartElement(void *ctxt, const xmlChar *uname, int enforce = 0; if ((ctx->cfg->doctype == fpi_html) || (ctx->cfg->doctype == fpi_xhtml)) { /* enforce html */ - enforce = 2; - if (!desc || desc->depr) + if (!desc || desc->depr) { + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, ctx->f->r, APLOGNO(01416) + "Bogus HTML element %s dropped", name); return; - + } + enforce = 2; } - else if ((ctx->cfg->doctype == fpi_html) - || (ctx->cfg->doctype == fpi_xhtml)) { - enforce = 1; + else if ((ctx->cfg->doctype == fpi_html_legacy) + || (ctx->cfg->doctype == fpi_xhtml_legacy)) { /* enforce html legacy */ if (!desc) { + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, ctx->f->r, APLOGNO(01417) + "Deprecated HTML element %s dropped", name); return; } - } - if (!desc && enforce) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, ctx->f->r, APLOGNO(01416) - "Bogus HTML element %s dropped", name); - return; - } - if (desc && desc->depr && (enforce == 2)) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, ctx->f->r, APLOGNO(01417) - "Deprecated HTML element %s dropped", name); - return; + enforce = 1; } #ifdef HAVE_STACK descp = apr_array_push(ctx->stack); -- 2.40.0