mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-04 19:54:14 +02:00
fix smarty security_policy issue in plugins {html_image} and {fetch}
This commit is contained in:
@@ -28,8 +28,8 @@ function smarty_function_fetch($params, $template)
|
||||
}
|
||||
|
||||
$content = '';
|
||||
if (isset($template->security_policy) && !preg_match('!^(http|ftp)://!i', $params['file'])) {
|
||||
if(!$template->security_policy->isTrustedResourceDir($params['file'])) {
|
||||
if (isset($template->smarty->security_policy) && !preg_match('!^(http|ftp)://!i', $params['file'])) {
|
||||
if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,8 +106,8 @@ function smarty_function_html_image($params, $template)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (isset($template->security_policy)) {
|
||||
if (!$template->security_policy->isTrustedResourceDir($_image_path)) {
|
||||
if (isset($template->smarty->security_policy)) {
|
||||
if (!$template->smarty->security_policy->isTrustedResourceDir($_image_path)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user