]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Limit language negotiation to bundled error pages
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 18 Jan 2010 01:09:32 +0000 (14:09 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 18 Jan 2010 01:09:32 +0000 (14:09 +1300)
src/errorpage.cc

index b0b773ebfd74b75785dde63f9035cce58e18c8d1..f3e6cb553bfe8c1061870d280537a2334a1b57ef 100644 (file)
@@ -962,9 +962,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