r96564 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96563‎ | r96564 | r96565 >
Date:13:53, 8 September 2011
Author:catrope
Status:ok
Tags:
Comment:
Use wfParseUrl() instead of parse_url() in MWHttpRequest::__construct(), and check the return value for false
Modified paths:
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HttpFunctions.php
@@ -184,9 +184,9 @@
185185 global $wgHTTPTimeout;
186186
187187 $this->url = wfExpandUrl( $url, PROTO_HTTP );
188 - $this->parsedUrl = parse_url( $this->url );
 188+ $this->parsedUrl = wfParseUrl( $this->url );
189189
190 - if ( !Http::isValidURI( $this->url ) ) {
 190+ if ( !$this->parsedUrl || !Http::isValidURI( $this->url ) ) {
191191 $this->status = Status::newFatal( 'http-invalid-url' );
192192 } else {
193193 $this->status = Status::newGood( 100 ); // continue

Status & tagging log