첨부파일의 본문 삽입시 상대경로로 저장하게 하고 출력시 Rewrite mod에 영향을 받지 않게 절대경로로 변경함

git-svn-id: http://xe-core.googlecode.com/svn/trunk@1961 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-07-19 23:01:37 +00:00
parent a522a2207e
commit d9dc99c577
8 changed files with 12 additions and 9 deletions

View file

@ -82,13 +82,10 @@
* @brief 최종 결과물의 출력
**/
function display($content) {
if(Context::getResponseMethod()=="XMLRPC") {
print $content;
return;
}
$path = str_replace('index.php','',$_SERVER['SCRIPT_NAME']);
// files로 시작되는 src나 href의 값을 절대경로로 변경
$content = preg_replace('!(href|src)=("|\'){0,1}files!is', '\\1=\\2'.$path.'files', $content);
print preg_replace('!(href|src)=("|\'){0,1}\.\/([a-zA-Z0-9\_^\/]+)\/!is', '\\1=\\2'.$path.'$3/', $content);
}