mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-06 07:11:37 +01:00
update file generation, replace crc32() '-' with 'N'
This commit is contained in:
@@ -13,7 +13,7 @@ function smarty_function_fetch($params, &$smarty)
|
||||
$file = $params['file'];
|
||||
|
||||
if (empty($file)) {
|
||||
$smarty->trigger_error("parameter 'file' cannot be empty");
|
||||
$smarty->_trigger_plugin_error("parameter 'file' cannot be empty");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,11 +26,11 @@ function smarty_function_fetch($params, &$smarty)
|
||||
}
|
||||
}
|
||||
if (!$resource_is_secure) {
|
||||
$smarty->trigger_error("(secure mode) fetch '$file' is not allowed");
|
||||
$smarty->_trigger_plugin_error("(secure mode) fetch '$file' is not allowed");
|
||||
return;
|
||||
}
|
||||
if (!@is_readable($file)) {
|
||||
$smarty->trigger_error("fetch cannot read file '$file'");
|
||||
$smarty->_trigger_plugin_error("fetch cannot read file '$file'");
|
||||
return;
|
||||
}
|
||||
// fetch the file
|
||||
@@ -89,7 +89,7 @@ function smarty_function_fetch($params, &$smarty)
|
||||
case "header":
|
||||
if(!empty($param_value)) {
|
||||
if(!preg_match('![\w\d-]+: .+!',$param_value)) {
|
||||
$smarty->trigger_error("invalid header format '".$param_value."'");
|
||||
$smarty->_trigger_plugin_error("invalid header format '".$param_value."'");
|
||||
return;
|
||||
} else {
|
||||
$extra_headers[] = $param_value;
|
||||
@@ -105,7 +105,7 @@ function smarty_function_fetch($params, &$smarty)
|
||||
if(!preg_match('!\D!', $param_value)) {
|
||||
$proxy_port = (int) $param_value;
|
||||
} else {
|
||||
$smarty->trigger_error("invalid value for attribute '".$param_key."'");
|
||||
$smarty->_trigger_plugin_error("invalid value for attribute '".$param_key."'");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -123,7 +123,7 @@ function smarty_function_fetch($params, &$smarty)
|
||||
if(!preg_match('!\D!', $param_value)) {
|
||||
$timeout = (int) $param_value;
|
||||
} else {
|
||||
$smarty->trigger_error("invalid value for attribute '".$param_key."'");
|
||||
$smarty->_trigger_plugin_error("invalid value for attribute '".$param_key."'");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -134,7 +134,7 @@ function smarty_function_fetch($params, &$smarty)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$smarty->trigger_error("unrecognized attribute '".$param_key."'");
|
||||
$smarty->_trigger_plugin_error("unrecognized attribute '".$param_key."'");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ function smarty_function_fetch($params, &$smarty)
|
||||
}
|
||||
|
||||
if(!$fp) {
|
||||
$smarty->trigger_error("unable to fetch: $errstr ($errno)");
|
||||
$smarty->_trigger_plugin_error("unable to fetch: $errstr ($errno)");
|
||||
return;
|
||||
} else {
|
||||
if($_is_proxy) {
|
||||
@@ -189,7 +189,7 @@ function smarty_function_fetch($params, &$smarty)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$smarty->trigger_error("unable to parse URL, check syntax");
|
||||
$smarty->_trigger_plugin_error("unable to parse URL, check syntax");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user