From a93d90a531d9c64a66d9c5f993b7bac59e136c9b Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Mon, 4 Feb 2013 22:32:25 +0000 Subject: [PATCH] mod_proxy_html: bugfixes and introduce HTML5 doctype git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1442409 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 9 +++++++++ modules/filters/mod_proxy_html.c | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index b6d1469e26..4623b79fc0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,15 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_proxy_html: process parsed comments immediately. + Fixes bug (seen in the wild when used with IBM's HTTPD bundle) + where parsed comments may be lost. [Nick Kew] + + *) mod_proxy_html: introduce doctype for HTML 5 [Nick Kew] + + *) mod_proxy_html: fix typo-bug processing "strict" vs "transitional" + HTML/XHTML [Nick Kew] + *) core: Fix valgrind warning about uninitialized memory in argument to semctl. PR 53690. [Mikhail T. ] diff --git a/modules/filters/mod_proxy_html.c b/modules/filters/mod_proxy_html.c index 6cbe87a968..15a601a548 100644 --- a/modules/filters/mod_proxy_html.c +++ b/modules/filters/mod_proxy_html.c @@ -126,6 +126,7 @@ static const char *const fpi_xhtml = "\n"; static const char *const fpi_xhtml_legacy = "\n"; +static const char *const fpi_html5 = "\n"; static const char *const html_etag = ">"; static const char *const xhtml_etag = " />"; /*#define DEFAULT_DOCTYPE fpi_html */ @@ -309,6 +310,7 @@ static void pcomment(void *ctxt, const xmlChar *uchars) ap_fputs(ctx->f->next, ctx->bb, ""); + dump_content(ctx); } } static void pendElement(void *ctxt, const xmlChar *uname) @@ -323,8 +325,8 @@ static void pendElement(void *ctxt, const xmlChar *uname) return; } - else if ((ctx->cfg->doctype == fpi_html) - || (ctx->cfg->doctype == fpi_xhtml)) { + else if ((ctx->cfg->doctype == fpi_html_legacy) + || (ctx->cfg->doctype == fpi_xhtml_legacy)) { /* enforce html legacy */ if (!desc) return; @@ -1128,6 +1130,10 @@ static const char *set_doctype(cmd_parms *cmd, void *CFG, else cfg->doctype = fpi_html; } + else if (!strcasecmp(t, "html5")) { + cfg->etag = html_etag; + cfg->doctype = fpi_html5; + } else { cfg->doctype = apr_pstrdup(cmd->pool, t); if (l && ((l[0] == 'x') || (l[0] == 'X'))) -- 2.40.0