mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-18 09:52:17 +09:00
Merge pull request #295 from kijin/pr/multidimensional-array
PHP 5.3에서 다차원 배열을 제출할 수 없는 문제 수정
This commit is contained in:
commit
4f23fdf6bc
1 changed files with 15 additions and 4 deletions
|
|
@ -1182,7 +1182,7 @@ class Context
|
|||
{
|
||||
continue;
|
||||
}
|
||||
$key = htmlentities($key);
|
||||
$key = escape($key);
|
||||
$val = $this->_filterRequestVar($key, $val);
|
||||
|
||||
if($requestMethod == 'GET' && isset($_GET[$key]))
|
||||
|
|
@ -1358,7 +1358,7 @@ class Context
|
|||
$result = array();
|
||||
foreach($val as $k => $v)
|
||||
{
|
||||
$k = htmlentities($k);
|
||||
$k = escape($k);
|
||||
if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
|
||||
{
|
||||
$result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
|
||||
|
|
@ -1377,10 +1377,21 @@ class Context
|
|||
|
||||
if($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc())
|
||||
{
|
||||
$result[$k] = stripslashes($result[$k]);
|
||||
if (is_array($result[$k]))
|
||||
{
|
||||
array_walk_recursive($result[$k], function(&$val) { $val = stripslashes($val); });
|
||||
}
|
||||
else
|
||||
{
|
||||
$result[$k] = stripslashes($result[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_array($result[$k]))
|
||||
if(is_array($result[$k]))
|
||||
{
|
||||
array_walk_recursive($result[$k], function(&$val) { $val = trim($val); });
|
||||
}
|
||||
else
|
||||
{
|
||||
$result[$k] = trim($result[$k]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue