Only include the ldap escaping if present within APR.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1589995 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Graham Leggett
2014-04-25 11:19:56 +00:00
parent 84358db95c
commit 1c88c53282

View File

@ -31,7 +31,10 @@
#include "apr_fnmatch.h"
#include "apr_base64.h"
#include "apr_sha1.h"
#include "apr_version.h"
#if APR_VERSION_AT_LEAST(1,5,0)
#include "apr_escape.h"
#endif
#include <limits.h> /* for INT_MAX */
@ -1062,12 +1065,13 @@ static const char *md5_func(ap_expr_eval_ctx_t *ctx, const void *data,
return ap_md5(ctx->p, (const unsigned char *)arg);
}
#if APR_VERSION_AT_LEAST(1,6,0)
static const char *ldap_func(ap_expr_eval_ctx_t *ctx, const void *data,
const char *arg)
{
return apr_pescape_ldap(ctx->p, arg, APR_ESCAPE_STRING, APR_ESCAPE_LDAP_ALL);
}
#endif
#define MAX_FILE_SIZE 10*1024*1024
static const char *file_func(ap_expr_eval_ctx_t *ctx, const void *data,
@ -1652,7 +1656,9 @@ static const struct expr_provider_single string_func_providers[] = {
{ unbase64_func, "unbase64", NULL, 0 },
{ sha1_func, "sha1", NULL, 0 },
{ md5_func, "md5", NULL, 0 },
#if APR_VERSION_AT_LEAST(1,6,0)
{ ldap_func, "ldap", NULL, 0 },
#endif
{ NULL, NULL, NULL}
};