I'm trying to write a patch to make a module follow the Drupal coding standards.
I get this complain and I don't know how to fix it.
Line 148: the use of REQUEST_URI is prone to XSS exploits and does not work on IIS; use
request_uri()
instead [security_12] return "http" . (isset($_SERVER['HTTPS']) ? "s" : "") . "://" . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
The function using that code is the following one.
function module_get_url() {
return "http" . (isset($_SERVER['HTTPS']) ? "s" : "") . "://" . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
}
Should I change the code to the following one?
function module_request_uri() {
return "http" . (isset($_SERVER['HTTPS']) ? "s" : "") . "://" . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
}