Make internal m_strcasestr default

This commit is contained in:
brenosilva 2012-08-15 16:08:02 +00:00
parent a4c68c8638
commit 9d19e7b06b
3 changed files with 7 additions and 12 deletions

View File

@ -288,7 +288,7 @@ int init_response_body_html_parser(modsec_rec *msr) {
} }
if((msr->r->content_encoding == NULL)||(apr_strnatcasecmp(msr->r->content_encoding,"(null)")==0)){ if((msr->r->content_encoding == NULL)||(apr_strnatcasecmp(msr->r->content_encoding,"(null)")==0)){
charset=ap_strcasestr(msr->r->content_type,"charset="); charset=m_strcasestr(msr->r->content_type,"charset=");
if(charset == NULL){ if(charset == NULL){
if (msr->txcfg->debuglog_level >= 4) if (msr->txcfg->debuglog_level >= 4)
msr_log(msr, 4, "init_response_body_html_parser: assuming ISO-8859-1."); msr_log(msr, 4, "init_response_body_html_parser: assuming ISO-8859-1.");
@ -1014,7 +1014,7 @@ int inject_encrypted_response_body(modsec_rec *msr, int elts) {
encoding = (const char *) htmlGetMetaEncoding(msr->crypto_html_tree); encoding = (const char *) htmlGetMetaEncoding(msr->crypto_html_tree);
if (ctype && encoding == NULL) { if (ctype && encoding == NULL) {
if (ctype && (p = ap_strcasestr(ctype, "charset=") , p != NULL)) { if (ctype && (p = m_strcasestr(ctype, "charset=") , p != NULL)) {
p += 8 ; p += 8 ;
if (encoding = apr_pstrndup(msr->mp, p, strcspn(p, " ;") ), encoding) { if (encoding = apr_pstrndup(msr->mp, p, strcspn(p, " ;") ), encoding) {
xmlCharEncoding enc; xmlCharEncoding enc;

View File

@ -569,9 +569,8 @@ char *file_basename(apr_pool_t *mp, const char *filename) {
return d; return d;
} }
/*
#if (defined(WIN32) || (HAVE_STRCASESTR == 0)) char *m_strcasestr(const char *haystack, const char *needle) {
char *strcasestr(const char *haystack, const char *needle) {
char aux, lower_aux; char aux, lower_aux;
int length; int length;
@ -588,8 +587,7 @@ char *strcasestr(const char *haystack, const char *needle) {
} }
return ((char *)haystack); return ((char *)haystack);
} }
#endif
*/
#ifdef WIN32 #ifdef WIN32
int inet_pton(int family, const char *src, void *dst) { int inet_pton(int family, const char *src, void *dst) {
struct addrinfo addr; struct addrinfo addr;

View File

@ -32,11 +32,8 @@
#include <ws2tcpip.h> #include <ws2tcpip.h>
int DSOLOCAL inet_pton(int family, const char *src, void *dst); int DSOLOCAL inet_pton(int family, const char *src, void *dst);
#endif #endif
/*
#if (defined(WIN32) || (HAVE_STRCASESTR == 0)) char DSOLOCAL *m_strcasestr(const char *haystack, const char *needle);
char DSOLOCAL *strcasestr(const char *haystack, const char *needle);
#endif
*/
int DSOLOCAL normalize_path_inplace(unsigned char *input, int len, int win, int *changed); int DSOLOCAL normalize_path_inplace(unsigned char *input, int len, int win, int *changed);