X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Fsmarty%2Flibs%2Finternals%2Fcore.is_secure.php;h=d54abd432275a75bba7c53274ca5c9866039c871;hb=9b7c11be09e7a553b26667f673c6315209ddc210;hp=9bec5c21efb57166ef324e30d39dcd9904b3c6f3;hpb=95a6ccc277bc41d750ced09fe5a1a779bde342c7;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/smarty/libs/internals/core.is_secure.php b/wwwroot/smarty/libs/internals/core.is_secure.php index 9bec5c2..d54abd4 100644 --- a/wwwroot/smarty/libs/internals/core.is_secure.php +++ b/wwwroot/smarty/libs/internals/core.is_secure.php @@ -27,7 +27,7 @@ function smarty_core_is_secure($params, &$smarty) foreach ((array)$params['resource_base_path'] as $curr_dir) { if ( ($_cd = realpath($curr_dir)) !== false && strncmp($_rp, $_cd, strlen($_cd)) == 0 && - $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR ) { + substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { return true; } } @@ -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 && + substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) { return true; } }