From a609ff183336288b7e01abadf6662bbe1310de30 Mon Sep 17 00:00:00 2001 From: mohrt Date: Thu, 19 Aug 2004 21:02:24 +0000 Subject: [PATCH] fix bug with fetch, passing user/pass in url did not work --- NEWS | 2 ++ libs/plugins/function.fetch.php | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index e2d0cd0b..b57abcb8 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - fix bug with fetch, passing user/pass in url did not work + (Monte) - fix occasional wrong error messages on mismatched tags when {else}, {elseif}, {foreachelse} or {sectionelse} is involved (messju) - fix handling of methods arguments (messju, Manfred Wischin) diff --git a/libs/plugins/function.fetch.php b/libs/plugins/function.fetch.php index 17d4c997..cbc3b0e3 100644 --- a/libs/plugins/function.fetch.php +++ b/libs/plugins/function.fetch.php @@ -64,8 +64,11 @@ function smarty_function_fetch($params, &$smarty) } else { $port = $uri_parts['port']; } - if(empty($uri_parts['user'])) { - $user = ''; + if(!empty($uri_parts['user'])) { + $user = $uri_parts['user']; + } + if(!empty($uri_parts['pass'])) { + $pass = $uri_parts['pass']; } // loop through parameters, setup headers foreach($params as $param_key => $param_value) {