Ignore:
Timestamp:
2013/11/18 16:55:43 (13 years ago)
Author:
michael_nelson
Message:

#2467 Merge (2.13.1-dev→2.12.6en-p1-dev)

File:
1 edited

Legend:

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

    r22502 r23283  
    17991799        } 
    18001800    } 
    1801 } 
     1801 
     1802    /** 
     1803     * Obtain the parts of path that are not the same and confirm if file exists 
     1804     * by reconstructing path with base path. 
     1805     * 
     1806     * @param  string  $file 
     1807     * @param  string  $base_path 
     1808     * @return bool true = exists / false does not exist 
     1809     */ 
     1810    public  function checkFileExistsWithInBasePath($file,$base_path)  
     1811    {   
     1812        $arrPath = explode('/', str_replace('\\', '/',$file)); 
     1813        $arrBasePath = explode('/', str_replace('\\', '/',$base_path)); 
     1814        $path_diff = implode("/",array_diff_assoc($arrPath, $arrBasePath)); 
     1815        return file_exists(realpath(str_replace('..','',$base_path . $path_diff))) ? true : false; 
     1816    } 
     1817     
     1818 } 
Note: See TracChangeset for help on using the changeset viewer.