diff --git a/sites/all/modules/contrib/fast_404/fast_404.inc b/sites/all/modules/contrib/fast_404/fast_404.inc index 446785c..75d1a66 100644 --- a/sites/all/modules/contrib/fast_404/fast_404.inc +++ b/sites/all/modules/contrib/fast_404/fast_404.inc @@ -127,6 +127,7 @@ function fast_404_validate_path_drupal() { if (count($path_parts) == 1) { return TRUE; } + $GLOBALS['fast_404_lang_prefix'] = $path_parts[0]; $q = substr($q, strlen($path_parts[0]) + 1); } } @@ -141,7 +142,9 @@ function fast_404_validate_path_drupal() { return $res == 0 ? FALSE : TRUE; } + return FALSE; + } /** @@ -237,20 +240,26 @@ function fast_404_error_return($load_html = FALSE, $return_gone = FALSE) { // will not reappear on the server. if ($return_gone) { header((variable_get('fast_404_HTTP_status_method', 'mod_php') == 'FastCGI' ? 'Status:' : 'HTTP/1.0') . ' 410 Gone'); - } else { + } + else { header((variable_get('fast_404_HTTP_status_method', 'mod_php') == 'FastCGI' ? 'Status:' : 'HTTP/1.0') . ' 404 Not Found'); } + $htmlErrorPage = variable_get('fast_404_HTML_error_page', FALSE); + $htmlErrorPage = str_ireplace('##LANG##', $GLOBALS['fast_404_lang_prefix'], $htmlErrorPage); + // If a file is set to provide us with fast_404 joy, load it if (($load_html || variable_get('fast_404_HTML_error_all_paths', FALSE)) - && file_exists(variable_get('fast_404_HTML_error_page', FALSE))) { - $fast_404_html = @file_get_contents(variable_get('fast_404_HTML_error_page', FALSE)); + && file_exists($htmlErrorPage) + ) { + $fast_404_html = @file_get_contents($htmlErrorPage); } // If we don't have fast 404 html yet, use the default if (!isset($fast_404_html) || empty($fast_404_html)) { $fast_404_html = variable_get('fast_404_html', '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'); } + print strtr($fast_404_html, array('@path' => check_plain(request_uri()))); exit(); }