From: Amos Jeffries Date: Fri, 29 Jan 2010 10:16:02 +0000 (+1300) Subject: Limit language negotiation to bundled error pages X-Git-Tag: SQUID_3_1_0_16~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=223814bbc367a7e568886afe6a0b00c0f8d263a2;p=thirdparty%2Fsquid.git Limit language negotiation to bundled error pages --- diff --git a/src/errorpage.cc b/src/errorpage.cc index cdc541a8ac..97bd6c5310 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -938,9 +938,10 @@ ErrorState::BuildContent() int l = 0; /** error_directory option in squid.conf overrides translations. + * Custom errors are always found either in error_directory or the templates directory. * Otherwise locate the Accept-Language header */ - if (!Config.errorDirectory && request && request->header.getList(HDR_ACCEPT_LANGUAGE, &hdr) ) { + if (!Config.errorDirectory && page_id < ERR_MAX && request && request->header.getList(HDR_ACCEPT_LANGUAGE, &hdr) ) { size_t pos = 0; // current parsing position in header string char *reset = NULL; // where to reset the p pointer for each new tag file