Updated to Smarty 2.6.26 (June 18th, 2009), we should update to Smarty 3.x (current...
[mirrors/Kyberia-bloodline.git] / wwwroot / smarty / libs / internals / core.is_secure.php
index 9bec5c21efb57166ef324e30d39dcd9904b3c6f3..d54abd432275a75bba7c53274ca5c9866039c871 100644 (file)
@@ -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;
                     }
                 }
This page took 0.13029 seconds and 4 git commands to generate.