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/Smarty/templates/default/admin/total/index.tpl

    r17351 r17605  
    2828    <th>月度集計</th> 
    2929    <td> 
    30       <form name="search_form1" id="search_form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->"> 
     30      <form name="search_form1" id="search_form1" method="post" action="?"> 
    3131        <input type="hidden" name="mode" value="search" /> 
    3232        <input type="hidden" name="form" value="1" /> 
     
    5050    <th>期間集計</th> 
    5151    <td> 
    52       <form name="search_form2" id="search_form2" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->"> 
     52      <form name="search_form2" id="search_form2" method="post" action="?"> 
    5353        <input type="hidden" name="mode" value="search" /> 
    5454        <input type="hidden" name="form" value="2" /> 
     
    9393<!--{* 検索結果一覧ここから *}--> 
    9494<!--{if count($arrResults) > 0}--> 
    95 <form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->"> 
     95<form name="form1" id="form1" method="post" action="?"> 
    9696<input type="hidden" name="mode" value="search" /> 
    9797<input type="hidden" name="type" value="<!--{$arrForm.type.value}-->" /> 
     
    127127<!--{else}--> 
    128128  <!--{if $smarty.post.mode == 'search'}--> 
    129   <form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->"> 
     129  <form name="form1" id="form1" method="post" action="?"> 
    130130  <input type="hidden" name="mode" value="search" /> 
    131131  <input type="hidden" name="type" value="<!--{$arrForm.type.value}-->" /> 
Note: See TracChangeset for help on using the changeset viewer.