Ignore:
Timestamp:
2008/09/10 20:50:26 (16 years ago)
Author:
Seasoft
Message:

/index.php にリンクやリダイレクトしている箇所の「index.php」を定数化。

  • 定数「DIR_INDEX_FILE」… DirectoryIndex? の実ファイル名。現状の EC-CUBE は、「index.php」。/html/define.php で定義するが、定義が無い場合 SC_Initial::defineDirectoryIndex() で「index.php」と定義。本来は、プログラム中で実ファイルとしての index.php を指すときとは、この定数を使うのが良い気がするが、今回はそこまでは書き換えていない。
  • 定数「USE_FILENAME_DIR_INDEX」… DIR_INDEX_FILE にアクセスするときにファイル名を使用するか。/html/define.php で定義。
  • 定数「DIR_INDEX_URL」… /index.php にリンクやリダイレクトしている箇所の「index.php」部分を示す。この定数は SC_Initial::defineDirectoryIndex() で自動生成する。

・$_SERVERPHP_SELF? や自身をあらわすファイル名を利用している箇所を文字列「?」に書き換え。これにより、/ が自己URLにリンクするときに /index.php となることを防ぐ。RFC3986 を参考にする。モバイル端末がこのRFCに準拠しているのか確信が無いので、モバイルではこの変更は見送った。
・従来 / にリンクしていた箇所に、定数「DIR_INDEX_URL」を付加。漏れがあると予測される。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/pages/admin/design/LC_Page_Admin_Design.php

    r17281 r17605  
    192192            if ($_POST['mode'] == 'preview') { 
    193193                if ($page_id === "") { 
    194                     $this->sendRedirect($this->getLocation("./index.php")); 
     194                    $this->sendRedirect($this->getLocation(DIR_INDEX_URL)); 
    195195                } 
    196196                $this->lfSetPreData($arrPageData, $objLayout); 
     
    198198                $_SESSION['preview'] = "ON"; 
    199199 
    200                 $this->sendRedirect($this->getLocation(URL_DIR . "preview/index.php", array("filename" => $arrPageData[0]["filename"]))); 
     200                $this->sendRedirect($this->getLocation(URL_DIR . "preview/" . DIR_INDEX_URL, array("filename" => $arrPageData[0]["filename"]))); 
    201201 
    202202            }else{ 
    203                 $this->sendRedirect($this->getLocation("./index.php", 
     203                $this->sendRedirect($this->getLocation(DIR_INDEX_URL, 
    204204                                            array("page_id" => $page_id, 
    205205                                                  "msg" => "on"))); 
     
    211211        if ($_POST['mode'] == 'delete' and  !$objLayout->lfCheckBaseData($page_id)) { 
    212212            $objLayout->lfDelPageData($page_id); 
    213             $this->sendRedirect($this->getLocation("./index.php")); 
     213            $this->sendRedirect($this->getLocation(DIR_INDEX_URL)); 
    214214        } 
    215215 
Note: See TracChangeset for help on using the changeset viewer.