diff --git a/NEWS b/NEWS index 1ad7dbc9..566ec795 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - silence PHP warnings in function.fetch.php (Eduardo, + Monte) - added get_config_vars(), same basic functionality as get_template_vars() (Monte) - update get_template_vars() to be able to get diff --git a/libs/plugins/function.fetch.php b/libs/plugins/function.fetch.php index d1d14742..d533f123 100644 --- a/libs/plugins/function.fetch.php +++ b/libs/plugins/function.fetch.php @@ -59,7 +59,7 @@ function smarty_function_fetch($params, &$smarty) $port = $uri_parts['port']; } if(empty($uri_parts['user'])) { - $user = $uri_parts['user']; + $user = ''; } // loop through parameters, setup headers foreach($params as $param_key => $param_value) { @@ -157,7 +157,7 @@ function smarty_function_fetch($params, &$smarty) if(!empty($referer)) { fputs($fp, "Referer: $referer\r\n"); } - if(is_array($extra_headers)) { + if(isset($extra_headers) && is_array($extra_headers)) { foreach($extra_headers as $curr_header) { fputs($fp, $curr_header."\r\n"); } @@ -165,7 +165,8 @@ function smarty_function_fetch($params, &$smarty) if(!empty($user) && !empty($pass)) { fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n"); } - + + $content = ''; fputs($fp, "\r\n"); while(!feof($fp)) { $content .= fgets($fp,4096);