From 18e355b701f84690e4df22a10eb424fb2eca4abf Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 17 Apr 2018 23:39:36 +0900 Subject: [PATCH] =?UTF-8?q?bool=20=EB=B3=80=EC=88=98=20=EB=B0=9B=EB=8A=94?= =?UTF-8?q?=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0.=20=EC=A0=84?= =?UTF-8?q?=EC=BD=98=20=EC=95=88=20=EA=B3=A0=EB=A5=BC=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=84=A0=ED=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/join_post.php | 4 +--- src/sammo/Util.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hwe/join_post.php b/hwe/join_post.php index 85001276..76c155bf 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -8,7 +8,6 @@ $v = new Validator($_POST + $_GET); $v ->rule('required', [ 'name', - 'pic', 'leader', 'power', 'intel' @@ -18,7 +17,6 @@ $v 'power', 'intel', 'character', - 'pic' ]) ->rule('lengthBetween', 'name', 1, 6) ->rule('min', [ @@ -46,7 +44,7 @@ $userID = Session::getUserID(); $name = Util::getReq('name'); $name = StringUtil::removeSpecialCharacter($name); -$pic = Util::getReq('pic', 'int', 0); +$pic = (int)Util::getReq('pic', 'bool', 0); $character = Util::getReq('character', 'int', 0); $leader = Util::getReq('leader', 'int', 50); diff --git a/src/sammo/Util.php b/src/sammo/Util.php index 2f4cbf4a..2b0a3bce 100644 --- a/src/sammo/Util.php +++ b/src/sammo/Util.php @@ -34,7 +34,7 @@ class Util extends \utilphp\util if ($type === 'bool') { $value = strtolower($value); - if ($value === '' || $value === 'off' || $value === 'false' || $value === 'no' || $value === 'n' || $value === 'x' || $value === 'null') { + if ($value === null || $value === '' || $value === 'off' || $value === 'false' || $value === 'no' || $value === 'n' || $value === 'x' || $value === 'null') { return false; } return !!$value;