IE에서 첨부파일 미리 보기 안되는 기능 및 Context에서 request arguments에 대해 filtering을 하는 기능 보완

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4702 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-10-28 01:31:28 +00:00
parent aaff38633c
commit b59ac03deb
5 changed files with 97 additions and 93 deletions

View file

@ -550,18 +550,7 @@
foreach($_REQUEST as $key => $val) {
if($val === "") continue;
if($key == "page" || $key == "cpage" || substr($key,-3)=="srl") $val = (int)$val;
else if(is_array($val) && count($val) ) {
foreach($val as $k => $v) {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $v = stripslashes($v);
$v = trim($v);
$val[$k] = $v;
}
} else {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $val = stripslashes($val);
$val = trim($val);
}
$val = $this->_filterRequestVar($key, $val);
if($this->_getRequestMethod()=='GET'&&$_GET[$key]) $set_to_vars = true;
elseif($this->_getRequestMethod()=='POST'&&$_POST[$key]) $set_to_vars = true;
else $set_to_vars = false;
@ -584,11 +573,30 @@
if(!count($params)) return;
foreach($params as $key => $obj) {
$val = trim($obj->body);
$val = $this->_filterRequestVar($key, $obj->body);
$this->_set($key, $val, true);
}
}
/**
* @brief 변수명에 따라서 필터링 처리
* _srl, page, cpage등의 변수는 integer로 형변환
**/
function _filterRequestVar($key, $val) {
if($key == "page" || $key == "cpage" || substr($key,-3)=="srl") return (int)$val;
if(is_array($val) && count($val) ) {
foreach($val as $k => $v) {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $v = stripslashes($v);
$v = trim($v);
$val[$k] = $v;
}
} else {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $val = stripslashes($val);
$val = trim($val);
}
return $val;
}
/**
* @brief 업로드 되었을 경우 return true
**/