diff --git a/NEWS b/NEWS index adc6a087..889700c9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fix notice in debug security check (Drakla, monte) - return valid reference in get_template_vars() when given var is non-existant (monte) - add escape type "urlpathinfo" to escape modifier (monte) diff --git a/libs/internals/core.is_secure.php b/libs/internals/core.is_secure.php index 9bec5c21..fcd7c33a 100644 --- a/libs/internals/core.is_secure.php +++ b/libs/internals/core.is_secure.php @@ -35,10 +35,10 @@ function smarty_core_is_secure($params, &$smarty) if (!empty($smarty->secure_dir)) { foreach ((array)$smarty->secure_dir as $curr_dir) { if ( ($_cd = realpath($curr_dir)) !== false) { - if( strncmp($_rp, $_cd, strlen($_cd)) == 0 && - $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR ) { + if($_cd == $_rp) { return true; - } elseif ($_cd == $_rp) { + } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 && + $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR) { return true; } }