From: Christophe Jaillet Date: Thu, 10 Jan 2019 22:41:59 +0000 (+0000) Subject: LanguagePriority should be case-insensitive in order to match AddLanguage behavior... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34738c56dfb04537353ce1501ea409cf40db43ec;p=apache LanguagePriority should be case-insensitive in order to match AddLanguage behavior. PR 39730 Test case added in r1850983 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1850989 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 69e5ec69f4..cc8051e098 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.1 + *) mod_negociation: LanguagePriority should be case-insensitive in order to + match AddLanguage behavior. PR 39730 [Christophe Jaillet] + *) mod_session: Always decode session attributes early. [Hank Ibell] *) core: Incorrect values for environment variables are substituted when diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 636c42d520..dc0211487c 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -1459,7 +1459,7 @@ static int find_lang_index(apr_array_header_t *accept_langs, char *lang) alang = (const char **) accept_langs->elts; for (i = 0; i < accept_langs->nelts; ++i) { - if (!strncmp(lang, *alang, strlen(*alang))) { + if (!ap_cstr_casecmpn(lang, *alang, strlen(*alang))) { return i; } alang += (accept_langs->elt_size / sizeof(char*));