$timeout was optional in Http::get()
authorGilles Dubuc <gdubuc@wikimedia.org>
Mon, 2 Mar 2015 19:25:29 +0000 (20:25 +0100)
committerGilles Dubuc <gdubuc@wikimedia.org>
Mon, 2 Mar 2015 19:25:29 +0000 (20:25 +0100)
Change-Id: I6cd2918412395d1d5f811f0d47bb080f22b598ec

includes/HttpFunctions.php

index 7f0d6a2..3728cdf 100644 (file)
@@ -91,7 +91,7 @@ class Http {
         */
        public static function get( $url, $options = array() ) {
                $args = func_get_args();
-               if ( is_string( $args[1] ) || is_numeric( $args[1] ) ) {
+               if ( isset( $args[1] ) && ( is_string( $args[1] ) || is_numeric( $args[1] ) ) ) {
                        // Second was used to be the timeout
                        // And third parameter used to be $options
                        wfWarn( "Second parameter should not be a timeout." );