mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
silence warnings in fetch plugin
This commit is contained in:
2
NEWS
2
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
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user