• I send my plugin to wordpress and got a response asking for a few things. one of them is sanitize the $_SERVER[‘HTTP_HOST’], how can i do this? im using this variable to get currently url:

    function get_current_url ( $args = false ) {
    	global $wp;
    	$host = $_SERVER['HTTP_HOST'];
    	$path = $wp->request;
    	$protocol = isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? "https" : "http";
    	$url = "$protocol://$host/$path";
    	return $args ? \add_query_arg( $_GET, $url ) : $url;
    }
    • This topic was modified 2 years, 7 months ago by Vinicius.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How sanitize $_SERVER[‘HTTP_HOST’] ?’ is closed to new replies.