From fe82ae0e2734a7e37305cc3f5b36b1bd220f7a3f Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 8 Sep 2011 13:53:18 +0000 Subject: [PATCH] Use wfParseUrl() instead of parse_url() in MWHttpRequest::__construct(), and check the return value for false --- includes/HttpFunctions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 20186f5105..aa69ae71e5 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -184,9 +184,9 @@ class MWHttpRequest { global $wgHTTPTimeout; $this->url = wfExpandUrl( $url, PROTO_HTTP ); - $this->parsedUrl = parse_url( $this->url ); + $this->parsedUrl = wfParseUrl( $this->url ); - if ( !Http::isValidURI( $this->url ) ) { + if ( !$this->parsedUrl || !Http::isValidURI( $this->url ) ) { $this->status = Status::newFatal( 'http-invalid-url' ); } else { $this->status = Status::newGood( 100 ); // continue -- 2.20.1