diff --git a/lib/common.lib.php b/lib/common.lib.php index 638a249e8..5505fedc9 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -2529,4 +2529,22 @@ function print_address($addr1, $addr2, $addr3) return $address; } + +// input vars 체크 +function check_input_vars() +{ + $max_input_vars = ini_get('max_input_vars'); + + if($max_input_vars) { + $post_vars = count($_POST, COUNT_RECURSIVE); + $get_vars = count($_GET, COUNT_RECURSIVE); + $cookie_vars = count($_COOKIE, COUNT_RECURSIVE); + + $input_vars = $post_vars + $get_vars + $cookie_vars; + + if($input_vars > $max_input_vars) { + alert('폼에서 전송된 변수의 개수가 max_input_vars 값보다 큽니다.\\n전송된 값중 일부는 유실되어 DB에 기록될 수 있습니다.\\n\\n문제를 해결하기 위해서는 서버 php.ini의 max_input_vars 값을 변경하십시오.'); + } + } +} ?> \ No newline at end of file