Ignore:
Timestamp:
2013/11/18 11:02:17 (13 years ago)
Author:
michael_nelson
Message:

#2441 コンテンツ管理 -> ファイル管理 のファイル指定処理が不正 の修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13_1/data/class/util/SC_Utils.php

    r23124 r23269  
    20922092        return array_reverse($arrTrail); 
    20932093    } 
     2094     
     2095    /** 
     2096     * Obtain the parts of path that are not the same and confirm if file exists 
     2097     * by reconstructing path with base path. 
     2098     * 
     2099     * @param  string  $file 
     2100     * @param  string  $base_path 
     2101     * @return bool true = exists / false does not exist 
     2102     */ 
     2103    public  function checkFileExistsWithInBasePath($file,$base_path)  
     2104    {   
     2105        $arrPath = explode('/', str_replace('\\', '/',$file)); 
     2106        $arrBasePath = explode('/', str_replace('\\', '/',$base_path)); 
     2107        $path_diff = implode("/",array_diff_assoc($arrPath, $arrBasePath)); 
     2108        return file_exists(realpath(str_replace('..','',$base_path . $path_diff))) ? true : false; 
     2109    } 
    20942110} 
Note: See TracChangeset for help on using the changeset viewer.