Forbidding to call file paths, that contain '..'

Rearranged the security checks.