Desinfectación de entrada para evitar XSS

$name = $_GET["name"];
$safename = htmlspecialchars($name);
echo "Welcome $safename";
Worrisome Wolf