Change this code to not construct the URL from user-controlled data

Pierre-Loup_Tristant can you please look into this Change this code to not perform client-side redirection based on user-controlled data