diff --git a/advagg.install b/advagg.install index 7e74489..e09eaa6 100644 --- a/advagg.install +++ b/advagg.install @@ -460,9 +460,14 @@ function advagg_install_check_via_http(&$requirements) { && strpos($request->data, '') === FALSE ) ) { + // Fast 404 check. + $parts = parse_url($url); $exclude_paths = variable_get('404_fast_paths_exclude', FALSE); - if (!empty($exclude_paths) && strpos($exclude_paths, 'advagg_') === FALSE) { + $fast_404_html = variable_get('404_fast_html', '404 Not Found

Not Found

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

'); + // Replace @path in the variable with the page path. + $fast_404_html = trim(strtr($fast_404_html, array('@path' => check_plain($parts['path'])))); + if ($fast_404_html == trim($request->data) && !empty($exclude_paths) && strpos($exclude_paths, 'advagg_') === FALSE) { if ($exclude_paths == '/\/(?:styles)\//') { $description = $t('Change it from /\/(?:styles)\// to /\/(?:styles|advagg_(cs|j)s)\// Current value: %value', array('%value' => $exclude_paths)); } @@ -473,17 +478,18 @@ function advagg_install_check_via_http(&$requirements) { 'title' => $t('Adv CSS/JS Agg - Fast 404: HTTP Request'), 'severity' => REQUIREMENT_ERROR, 'value' => $t('HTTP requests to advagg for ' . $type . ' files are not getting through.'), - 'description' => $t('If you have fast 404 enabled in your settings.php file, you need to change the 404_fast_paths_exclude setting so advagg will work.') . ' ' . $description, + 'description' => $t('If you have fast 404 enabled in your settings.php file, you need to change the 404_fast_paths_exclude setting so advagg will work.') . ' ' . $description, + ); + } + else { + // Menu callback failed. + $requirements['advagg_' . $type . '_generation'] = array( + 'title' => $t('Adv CSS/JS Agg - HTTP Request'), + 'severity' => REQUIREMENT_ERROR, + 'value' => $t('HTTP requests to advagg for ' . $type . ' files are not getting through.'), + 'description' => $t('Raw request info:
@request
', array('@request' => print_r($request, TRUE))) ); } - - // Menu callback failed. - $requirements['advagg_' . $type . '_generation'] = array( - 'title' => $t('Adv CSS/JS Agg - HTTP Request'), - 'severity' => REQUIREMENT_ERROR, - 'value' => $t('HTTP requests to advagg for ' . $type . ' files are not getting through.'), - 'description' => $t('Raw request info:
@request
', array('@request' => print_r($request, TRUE))) - ); } }