Changeset 17196


Ignore:
Timestamp:
2008/04/01 14:49:53 (12 years ago)
Author:
satou
Message:

#259 windows環境のバックスラッシュ(\)に対応。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2/data/class/batch/SC_Batch_Update.php

    r17195 r17196  
    218218    function mkdir_p($path){ 
    219219        $path = dirname($path); 
    220         $path = str_replace ('\\', '/', $path); 
    221220         
    222221        // HTML_PATH/DATA_PATHの判別 
    223         if (preg_match("@".HTML_PATH."@", $path) > 0) { 
    224             $dir = HTML_PATH; 
    225             $re_path = preg_replace("@".HTML_PATH."@", "", $path); 
    226         } elseif (preg_match("@".DATA_PATH."@", $path) > 0) { 
    227             $dir = DATA_PATH; 
    228             $re_path = preg_replace("@".DATA_PATH."@", "", $path); 
     222        if (preg_match("@\Q".HTML_PATH."\E@", $path) > 0) { 
     223            $dir = str_replace("\\", "/", HTML_PATH); 
     224            $path = preg_replace("@\Q".HTML_PATH."\E@", "", $path); 
     225        } elseif (preg_match("@\Q".DATA_PATH."\E@", $path) > 0) { 
     226            $dir = str_replace("\\", "/", DATA_PATH); 
     227            $path = preg_replace("@\Q".DATA_PATH."\E@", "", $path); 
    229228        } else { 
    230229            $dir = ""; 
    231             $re_path = $path; 
    232         } 
    233         $arrDirs = explode("/", $re_path); 
     230        } 
     231        $arrDirs = explode("/", str_replace("\\", "/", $path)); 
    234232 
    235233        foreach($arrDirs as $n){ 
Note: See TracChangeset for help on using the changeset viewer.