Add a bad request check to hook.php.