If a style of a not found media is requested, Drupal works for nothing !
I've added a test in fast_404 to avoid that work, and returning a 404 error if the original file doesn't exists.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cutesquirrel’s picture

adammalone’s picture

Status: Patch (to be ported) » Needs work
+++ b/sites/all/modules/contrib/fast_404/fast_404.inc
@@ -131,6 +131,22 @@ function fast_404_validate_path_drupal() {
+    $basePath = trim(`pwd`);

We should not be executing shell code from Drupal. Consider using the base_path function instead.

Similar functionality has made it into Drupal core with #927138: Fail image generation with 404 instead of 500, when source file is missing. I think the aim of this is to provide a faster 404 for non-present image derivatives although it seems like an edge case.