diff options
author | André Malo <nd@apache.org> | 2004-01-12 22:19:58 +0100 |
---|---|---|
committer | André Malo <nd@apache.org> | 2004-01-12 22:19:58 +0100 |
commit | b5985f2a1879eceb11711680465b3f3d9163aa63 (patch) | |
tree | 428c9e9e8ea11a854dc6c94bc14413027be29813 /server/log.c | |
parent | backport done (diff) | |
download | apache2-b5985f2a1879eceb11711680465b3f3d9163aa63.tar.xz apache2-b5985f2a1879eceb11711680465b3f3d9163aa63.zip |
allow unescaped errorlogs via compile time switch
Submitted by: Geoffrey Young <geoff modperlcookbook.org>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102302 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/log.c')
-rw-r--r-- | server/log.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/server/log.c b/server/log.c index b8ae92e45e..9164db7ec4 100644 --- a/server/log.c +++ b/server/log.c @@ -402,7 +402,10 @@ static void log_error_core(const char *file, int line, int level, const request_rec *r, apr_pool_t *pool, const char *fmt, va_list args) { - char errstr[MAX_STRING_LEN], scratch[MAX_STRING_LEN]; + char errstr[MAX_STRING_LEN]; +#ifndef AP_ERROR_LOG_UNESCAPED + char scratch[MAX_STRING_LEN]; +#endif apr_size_t len, errstrlen; apr_file_t *logf = NULL; const char *referer; @@ -539,15 +542,28 @@ static void log_error_core(const char *file, int line, int level, } errstrlen = len; +#ifndef AP_ERROR_LOG_UNESCAPED if (apr_vsnprintf(scratch, MAX_STRING_LEN - len, fmt, args)) { len += ap_escape_errorlog_item(errstr + len, scratch, MAX_STRING_LEN - len); } +#else + len += apr_vsnprintf(errstr + len, MAX_STRING_LEN - len, fmt, args); +#endif if ( r && (referer = apr_table_get(r->headers_in, "Referer")) - && ap_escape_errorlog_item(scratch, referer, MAX_STRING_LEN - len)) { +#ifndef AP_ERROR_LOG_UNESCAPED + && ap_escape_errorlog_item(scratch, referer, MAX_STRING_LEN - len) +#endif + ) { len += apr_snprintf(errstr + len, MAX_STRING_LEN - len, - ", referer: %s", scratch); + ", referer: %s", +#ifndef AP_ERROR_LOG_UNESCAPED + scratch +#else + referer +#endif + ); } /* NULL if we are logging to syslog */ |