Prevent relative or invalid paths to public functions #5825, #5802