Was told by IT admin that their security scan of a newly acquired website makes use of the following shared snippet below which is used in the head portion on a website and opens up many vulnerabilities and should be changed to use htmlentities instead.
I came across this thread which provided some insight however in this use case I am not so sure the vulnerability exists or is even within the realm of feasability, not to say it's not possible due to the server being on https?
Is this the safest way to handle a form PHP
If it's on https, should that not negate any vulnerability potential?
Original
<link rel="canonical" href="https://www.ourwebsite.com<?php echo echo $_SERVER['PHP_SELF']; ?>" />
New
<link rel="canonical" href="https://www.ourwebsite.com<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" />