#961: Do not rely on $_POST['redirect_url'].
#961: Refactor code - create a new validate_redirect() function.