mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
fix smarty security_policy issue in plugins {html_image} and {fetch}
This commit is contained in:
@@ -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.
|
||||
|
||||
|
@@ -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