Commit 17983218 authored by Nick Kew's avatar Nick Kew
Browse files

Backport r730296: fix for HTML entity escaping in mod_include,

including enhancement of ap_escape_html API.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@732583 13f79535-47bb-0310-9956-ffa450edef68
parent 0ce6568a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.2.12

  *) mod_include: support generating non-ASCII characters as entities in SSI
     PR 25202 [Nick Kew] 

  *) core/utils: Enhance ap_escape_html API to support escaping non-ASCII chars
     [Nick Kew]

  *) mod_rewrite: fix "B" flag breakage by reverting r589343
     PR 45529 [Bob Ionescu <bobsiegen googlemail.com>]

+0 −9
Original line number Diff line number Diff line
@@ -93,15 +93,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
    http://svn.apache.org/viewvc?view=rev&revision=731594
    +1: niq, rpluem, covener

  * Enhance ap_escape_html to add an option to escape all non-ASCII
    characters.  Use this to fix mod_include's handling of entities.
    PR 25202
      trunk:
        http://svn.apache.org/viewvc?view=rev&revision=730296
      2.2.x:
        http://people.apache.org/~niq/patches/25202
    +1: niq, rpluem, covener

PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]

+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@
 * 20051115.19 (2.2.11) Added ap_timeout_parameter_parse to util.c / httpd.h
 * 20051115.20 (2.2.11) Add ap_proxy_buckets_lifetime_transform to mod_proxy.h
 * 20051115.21 (2.2.11) Export mod_rewrite.h in the public API
 * 20051115.22 (2.2.12) Add ap_escape_html2 API, with additional option
 */

#define MODULE_MAGIC_COOKIE 0x41503232UL /* "AP22" */
+8 −0
Original line number Diff line number Diff line
@@ -1495,6 +1495,14 @@ AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partia
 * @return The escaped string
 */
AP_DECLARE(char *) ap_escape_html(apr_pool_t *p, const char *s);
/**
 * Escape an html string
 * @param p The pool to allocate from
 * @param s The html to escape
 * @param toasc Whether to escape all non-ASCII chars to &#nnn;
 * @return The escaped string
 */
AP_DECLARE(char *) ap_escape_html2(apr_pool_t *p, const char *s, int toasc);

/**
 * Escape a string for logging
+2 −1
Original line number Diff line number Diff line
@@ -1812,7 +1812,8 @@ static apr_status_t handle_echo(include_ctx_t *ctx, ap_filter_t *f,
                    echo_text = ap_escape_uri(ctx->dpool, val);
                    break;
                case E_ENTITY:
                    echo_text = ap_escape_html(ctx->dpool, val);
                    /* PR#25202: escape anything non-ascii here */
                    echo_text = ap_escape_html2(ctx->dpool, val, 1);
                    break;
                }

Loading