]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Limit language negotiation to bundled error pages
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 29 Jan 2010 10:16:02 +0000 (23:16 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 29 Jan 2010 10:16:02 +0000 (23:16 +1300)
src/errorpage.cc

index cdc541a8ac83840bfdf2fb8bc7afcc1456ac8986..97bd6c5310c5208a86a942010a3440284d9b0abd 100644 (file)
@@ -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