fix smarty security_policy issue in plugins {html_image} and {fetch}

This commit is contained in:
rodneyrehm
2011-06-09 07:52:58 +00:00
parent 0c552377cd
commit bc96213c44
3 changed files with 7 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
===== SVN trunk =====
09/0672011
- bugfix smarty security_policy issue in plugins {html_image} and {fetch}
07/06/2011
- bugfix registerFilter() or registerPlugin() on template objects did register to the main Smarty object if the register methods had been used on the main Smarty object before.

View File

@@ -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;
}

View File

@@ -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;
}
}