Fix bug in directory whitelist

Run `phpunit --coverage-html` to reproduce the error.