X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhttp%2FHttp.php;h=779d60634674b060f65b1e70681098d32c30a275;hb=d67197fa116acc366419faedeeacd91158a98f8b;hp=43ae2d0e8fe998b0e1f04b52cb2de58c60278526;hpb=1dd2e07276e1deaf431ddb01c92111038f9e2cd6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/http/Http.php b/includes/http/Http.php index 43ae2d0e8f..779d606346 100644 --- a/includes/http/Http.php +++ b/includes/http/Http.php @@ -51,6 +51,8 @@ class Http { * - userAgent A user agent, if you want to override the default * MediaWiki/$wgVersion * - logger A \Psr\Logger\LoggerInterface instance for debug logging + * - username Username for HTTP Basic Authentication + * - password Password for HTTP Basic Authentication * @param string $caller The method making this request, for profiling * @return string|bool (bool)false on failure or a string on success */ @@ -74,7 +76,7 @@ class Http { } else { $errors = $status->getErrorsByType( 'error' ); $logger = LoggerFactory::getInstance( 'http' ); - $logger->warning( $status->getWikiText( false, false, 'en' ), + $logger->warning( Status::wrap( $status )->getWikiText( false, false, 'en' ), [ 'error' => $errors, 'caller' => $caller, 'content' => $req->getContent() ] ); return false; } @@ -140,7 +142,7 @@ class Http { * @return bool */ public static function isValidURI( $uri ) { - return preg_match( + return (bool)preg_match( '/^https?:\/\/[^\/\s]\S*$/D', $uri );