Changeset 18569 for branches/comu-ver2


Ignore:
Timestamp:
2010/02/16 13:30:37 (14 years ago)
Author:
shutta
Message:

r18568 をマージ。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/util/SC_Utils.php

    r18566 r18569  
    8484            // htmlディレクトリとDOCUMENT_ROOTの相対パスがURL_DIR 
    8585            $document_root = realpath($_SERVER['DOCUMENT_ROOT']); 
    86             $url_dir = preg_replace('|^' . preg_quote($document_root) . '|', '', $eccube_html_dir); 
     86            $url_dir = str_replace($document_root, '', $eccube_html_dir); 
     87 
    8788            // installページへのURLを生成。 
    88             $location = realpath('/' . $url_dir . '/install/index.php'); 
     89            // Windowsの場合は, ディレクトリの区切り文字を\から/に変換する 
     90            $url_dir = str_replace("\\", "/", $url_dir); 
     91            // 先頭が'/'でない場合は'/'を付与。(php4,5のrealpathの挙動の違いによる) 
     92            if (substr($url_dir, 0, 1) != '/') { 
     93                $url_dir = '/' . $url_dir; 
     94            } 
     95            // 最後が'/'でない場合は'/'を付与。 
     96            if (substr($url_dir, -1) != '/') { 
     97                $url_dir .= '/'; 
     98            } 
     99            $location = $url_dir . 'install/index.php'; 
    89100 
    90101            header('Location: ' . $location); 
Note: See TracChangeset for help on using the changeset viewer.