apache rewrite 사용중일경우

본문의 링크 재정의 

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4664 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2008-10-21 05:23:23 +00:00
parent 5bca2eacfd
commit 9a8f340ec6

View file

@ -251,6 +251,12 @@
$_SESSION['accessible'][$this->document_srl] = true;
$content = $this->get('content');
// rewrite모듈을 사용하면 링크 재정의
$oContext = &Context::getInstance();
if($oContext->allow_rewrite) {
$content = preg_replace('/<a([ \t]+)href=("|\')\.\/\?/i',"<a href=\\2". Context::getRequestUri() ."?", $content);
}
// url에 대해서 정규표현식으로 치환
//$content = preg_replace('!([^>^"^\'^=])(http|https|ftp|mms):\/\/([^ ^<^"^\']*)!is','$1<a href="$2://$3" onclick="window.open(this.href);return false;">$2://$3</a>',' '.$content);