메뉴 캐시파일 생성시 절대 경로가 아닌 상대경로로 url을 생성하도록 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3975 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-03-19 06:32:46 +00:00
parent a1c6212c04
commit e237944abf
2 changed files with 11 additions and 7 deletions

View file

@ -466,8 +466,8 @@
* 현재 요청받은 스크립트 경로를 return
**/
function getScriptPath() {
//if(function_exists('php_sapi_name') && php_sapi_name()=='cgi') return preg_replace('/index.php/i','',$_SERVER['PATH_INFO']);
return preg_replace('/index.php/i','',$_SERVER['SCRIPT_NAME']);
$url = $_SERVER['PHP_SELF']?$_SERVER['PHP_SELF']:($_SERVER['REQUEST_URI']?$_SERVER['REQUEST_URI']:$_SERVER['URL']);
return preg_replace('/index.php/i','',$url);
}
/**
@ -513,4 +513,4 @@
if($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128);
return '';
}
?>
?>

View file

@ -397,8 +397,10 @@
$name_str = sprintf('$_names = array(%s); print $_names[$_SESSION["lang_type"]];', $name_arr_str);
$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url)) $href = getUrl('','mid',$node->url);
else $href = $url;
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url)) {
$href = getUrl('','mid',$node->url);
$href = str_replace(Context::getRequestUri(),'/',$href);
} else $href = $url;
$open_window = $node->open_window;
$expand = $node->expand;
@ -487,8 +489,10 @@
// 변수 정리
$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url)) $href = getUrl('','mid',$node->url);
else $href = $url;
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url)) {
$href = getUrl('','mid',$node->url);
$href = str_replace(Context::getRequestUri(),'/',$href);
} else $href = $url;
$open_window = $node->open_window;
$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);