fix bug with fetch, passing user/pass in url did not work

This commit is contained in:
mohrt
2004-08-19 21:02:24 +00:00
parent a0fbf0d8be
commit a609ff1833
2 changed files with 7 additions and 2 deletions

2
NEWS
View File

@@ -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 - fix occasional wrong error messages on mismatched tags when
{else}, {elseif}, {foreachelse} or {sectionelse} is involved (messju) {else}, {elseif}, {foreachelse} or {sectionelse} is involved (messju)
- fix handling of methods arguments (messju, Manfred Wischin) - fix handling of methods arguments (messju, Manfred Wischin)

View File

@@ -64,8 +64,11 @@ function smarty_function_fetch($params, &$smarty)
} else { } else {
$port = $uri_parts['port']; $port = $uri_parts['port'];
} }
if(empty($uri_parts['user'])) { if(!empty($uri_parts['user'])) {
$user = ''; $user = $uri_parts['user'];
}
if(!empty($uri_parts['pass'])) {
$pass = $uri_parts['pass'];
} }
// loop through parameters, setup headers // loop through parameters, setup headers
foreach($params as $param_key => $param_value) { foreach($params as $param_key => $param_value) {