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
This commit is contained in:
Ingo Schommer 2007-09-15 21:07:51 +00:00
parent 180c06fd15
commit 56853999bb
1 changed files with 4 additions and 1 deletions

View File

@ -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";