]> granicus.if.org Git - apache/commitdiff
The other half of r1442409: fix mod_proxy_html doctype-handling typos
authorNick Kew <niq@apache.org>
Mon, 27 Nov 2017 14:34:09 +0000 (14:34 +0000)
committerNick Kew <niq@apache.org>
Mon, 27 Nov 2017 14:34:09 +0000 (14:34 +0000)
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

index 743f1437806c65d56c33645647908a8710fe51c6..fc28b278d95bdbed1497114f57f3bf48c96aa85e 100644 (file)
@@ -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);