#439 php의 결과물과 javascript의 setQuery함수에 index.php 파일 지정 없이 /?... 등으로 지정될 경우 index.php를 명시적으로 추가하도록 하여 index.html파일등이 있더라도 문제 없도록 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4065 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-04-03 03:27:09 +00:00
parent e25d48baef
commit 4858c14c17
2 changed files with 8 additions and 3 deletions

View file

@ -892,6 +892,9 @@
// <img|br> 코드 변환 // <img|br> 코드 변환
$content = preg_replace('/<(img|br)([^>\/]*)(\/>|>)/i','<$1$2 />', $content); $content = preg_replace('/<(img|br)([^>\/]*)(\/>|>)/i','<$1$2 />', $content);
// 주소/?mid등과 같은 index.php가 명시되지 않은 파일의 target 변경
$content = str_replace(Context::getRequestUri().'?',Context::getRequestUri().'index.php?',$content);
return $content; return $content;
} }

View file

@ -27,6 +27,7 @@ String.prototype.setQuery = function(key, val) {
var idx = this.indexOf('?'); var idx = this.indexOf('?');
var uri = this; var uri = this;
uri = uri.replace(/#$/,''); uri = uri.replace(/#$/,'');
if(idx != -1) { if(idx != -1) {
uri = this.substr(0, idx); uri = this.substr(0, idx);
var query_string = this.substr(idx+1, this.length); var query_string = this.substr(idx+1, this.length);
@ -43,11 +44,12 @@ String.prototype.setQuery = function(key, val) {
q_list[q_list.length] = i+'='+arg; q_list[q_list.length] = i+'='+arg;
} }
return uri+"?"+q_list.join("&"); uri = uri+"?"+q_list.join("&");
} else { } else {
if(val.toString().trim()) return uri+"?"+key+"="+val; if(val.toString().trim()) uri = uri+"?"+key+"="+val;
else return uri;
} }
uri = uri.replace(request_uri+'?',request_uri+'index.php?');
return uri;
} }
/** /**