Changeset 20418
- Timestamp:
- 2011/02/26 18:59:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileView.php
r20417 r20418 114 114 $file = $objFormParam->getValue('file'); 115 115 116 // ソースとして表示するファイルを定義(直接実行しないファイル) 117 $arrViewFile = array( 118 'html', 119 'htm', 120 'tpl', 121 'php', 122 'css', 123 'js', 124 ); 125 126 $extension = pathinfo($objFormParam->getValue('file'), PATHINFO_EXTENSION); 127 128 if (!preg_match('|\./|', $file) && in_array($extension, $arrViewFile)) { 116 if (!preg_match('|\./|', $file)) { 129 117 $file_check_flg = true; 130 118 } … … 139 127 */ 140 128 function execFileView($objFormParam) { 141 $objFileManager = new SC_Helper_FileManager_Ex(); 142 // ファイルを読み込んで表示 143 header("Content-type: text/plain\n\n"); 144 print($objFileManager->sfReadFile(USER_REALDIR . $objFormParam->getValue('file'))); 129 $file = $objFormParam->getValue('file'); 130 131 // ソースとして表示するファイルを定義(直接実行しないファイル) 132 $arrViewFile = array( 133 'html', 134 'htm', 135 'tpl', 136 'php', 137 'css', 138 'js', 139 ); 140 141 $extension = pathinfo($file, PATHINFO_EXTENSION); 142 143 if (in_array($extension, $arrViewFile)) { 144 $objFileManager = new SC_Helper_FileManager_Ex(); 145 // ファイルを読み込んで表示 146 header("Content-type: text/plain\n\n"); 147 print($objFileManager->sfReadFile(USER_REALDIR . $file)); 148 } else { 149 SC_Response_Ex::sendRedirect(USER_URL . $file); 150 } 145 151 } 146 152 }
Note: See TracChangeset
for help on using the changeset viewer.