diff --git a/www-api/app/Controllers/WrenchMedia.php b/www-api/app/Controllers/WrenchMedia.php index 52b00fe6..fbb695d4 100644 --- a/www-api/app/Controllers/WrenchMedia.php +++ b/www-api/app/Controllers/WrenchMedia.php @@ -51,12 +51,16 @@ class WrenchMedia extends BaseController $fileSection = $uriSegments[$segLen-2]; $fileUID = $uriSegments[$segLen-1]; - $supportedSections = ['profile'=>100,'myfile'=>200,'contracts'=>300,'family'=>400]; - if (!in_array($fileSection, $supportedSections)) { - // section not supported - // return; + $supportedSections = ['profile'=>100,'myfile'=>200,'contracts'=>300,'family'=>400,'jobs'=>500]; + if (!array_key_exists($fileSection, $supportedSections)) { + $file = 'error.png'; + header('Content-Type: image/png'); + readfile($file); + exit(); + } + else{ + // echo "all good"; } - /* * VERIFY ALL PARAMETERS ARE GOOD #define WRENCH_FILE_PROFILE 100 @@ -78,7 +82,7 @@ class WrenchMedia extends BaseController readfile($file); exit(); - + //We can check cache for the file or // OR diff --git a/www-api/app/Controllers/error.png b/www-api/app/Controllers/error.png new file mode 100644 index 00000000..7c2563e1 Binary files /dev/null and b/www-api/app/Controllers/error.png differ