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

r18564 の修正。
Windows系だと不具合があった。
 http://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=5385&forum=4&post_id=25972

File:
1 edited

Legend:

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

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