From 56853999bb35a6e0220ca3a39c59b50729fa6200 Mon Sep 17 00:00:00 2001 From: Ingo Schommer <ingo@silverstripe.com> Date: Sat, 15 Sep 2007 21:07:51 +0000 Subject: [PATCH] elofgren: VAR FIX: Prevent 'auth' from being undefined in HTTP::sendRequest() (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41941 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/HTTP.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/HTTP.php b/core/HTTP.php index 78ffe60fa..dc20b963b 100644 --- a/core/HTTP.php +++ b/core/HTTP.php @@ -208,8 +208,11 @@ class HTTP { if( $query ) $query = '?' . $query; - if( self::$userName && self::$password ) + if( self::$userName && self::$password ) { $auth = "Authorization: Basic " . base64_encode( self::$userName . ':' . self::$password ) . "\r\n"; + } else { + $auth = ''; + } $request = "GET {$path}{$query} HTTP/1.1\r\nHost: $host\r\nConnection: Close\r\n{$auth}\r\n";