mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 22:33:10 +09:00
merge from 1.5.3 (~r10951). required minify admin.min.js
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.1@10952 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
commit
d97822999e
34 changed files with 233 additions and 127 deletions
|
|
@ -847,19 +847,42 @@ class Context {
|
|||
* @return mixed filtered value. Type are string or array
|
||||
*/
|
||||
function _filterRequestVar($key, $val, $do_stripslashes = 1) {
|
||||
if( ($key == 'page' || $key == 'cpage' || substr($key,-3)=='srl')) return !preg_match('/^[0-9,]+$/',$val)?(int)$val:$val;
|
||||
if($key == 'mid' || $key == 'vid' || $key == 'search_keyword') return htmlspecialchars($val);
|
||||
if(is_array($val) && count($val) ) {
|
||||
foreach($val as $k => $v) {
|
||||
if($do_stripslashes && version_compare(PHP_VERSION, '5.9.0', '<') && get_magic_quotes_gpc()) $v = stripslashes($v);
|
||||
$v = trim($v);
|
||||
$val[$k] = $v;
|
||||
}
|
||||
} else {
|
||||
if($do_stripslashes && version_compare(PHP_VERSION, '5.9.0', '<') && get_magic_quotes_gpc()) $val = stripslashes($val);
|
||||
$val = trim($val);
|
||||
$isArray = TRUE;
|
||||
if(!is_array($val))
|
||||
{
|
||||
$isArray = FALSE;
|
||||
$val = array($val);
|
||||
}
|
||||
|
||||
foreach($val as $k => $v)
|
||||
{
|
||||
if($key === 'page' || $key === 'cpage' || substr($key, -3) === 'srl')
|
||||
{
|
||||
$val[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int)$v : $v;
|
||||
}
|
||||
elseif($key === 'mid' || $key === 'vid' || $key === 'search_keyword')
|
||||
{
|
||||
$val[$k] = htmlspecialchars($v);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($do_stripslashes && version_compare(PHP_VERSION, '5.9.0', '<') && get_magic_quotes_gpc())
|
||||
{
|
||||
$v = stripslashes($v);
|
||||
}
|
||||
|
||||
$val[$k] = trim($v);
|
||||
}
|
||||
}
|
||||
|
||||
if($isArray)
|
||||
{
|
||||
return $val;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $val[0];
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue