fix: proper initialistaion of $content.

thanks to Dmitry Koteroff for pointing this out.
This commit is contained in:
messju
2004-06-01 16:46:43 +00:00
parent a00ee39cd6
commit 50b6c2b425

View File

@@ -26,6 +26,7 @@ function smarty_function_fetch($params, &$smarty)
return; return;
} }
$content = '';
if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) { if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
$_params = array('resource_type' => 'file', 'resource_name' => $params['file']); $_params = array('resource_type' => 'file', 'resource_name' => $params['file']);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php'); require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php');
@@ -171,7 +172,6 @@ function smarty_function_fetch($params, &$smarty)
fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n"); fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
} }
$content = '';
fputs($fp, "\r\n"); fputs($fp, "\r\n");
while(!feof($fp)) { while(!feof($fp)) {
$content .= fgets($fp,4096); $content .= fgets($fp,4096);