Skip to content
Snippets Groups Projects
Commit d5fe2b0b authored by Stein Magne Bjorklund's avatar Stein Magne Bjorklund
Browse files

Issue 6 Reformatting and improved variable names

- Removed no longer needed inline comments.
parent e7588ceb
No related branches found
No related tags found
1 merge request!5add check for static dir and static/img
......@@ -99,13 +99,12 @@ class StaticModule extends abstractModule{
*/
private function validateDirectory(array $conf, $file): void
{
$staticdir = realpath($conf['static']['directory']);
$imgdir = realpath($conf['static']['directory'] . "img");
$resourcepath = realpath($conf['static']['directory'].$file);
$staticDirectory = realpath($conf['static']['directory']);
$imgDirectory = realpath($conf['static']['directory'] . "img");
$resourcePath = realpath($conf['static']['directory'] . $file);
// static resources should be in static or img dir (img may be symlinked, check realpath of img as well)
if (strpos($resourcepath, $staticdir)!== 0 and strpos($resourcepath, $imgdir)!== 0) {
HTTPStatus::send404($file); // send404 calls exit();//
if (strpos($resourcePath, $staticDirectory) !== 0 && strpos($resourcePath, $imgDirectory) !== 0) {
HTTPStatus::send404($file);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment