diff --git a/hwe/_119_b.php b/hwe/_119_b.php index e6dfe110..34ba6505 100644 --- a/hwe/_119_b.php +++ b/hwe/_119_b.php @@ -24,6 +24,8 @@ $btn = Util::getReq('btn'); $minute = Util::getReq('minute', 'int'); $minute2 = Util::getReq('minute2', 'int'); +extractMissingPostToGlobals(); + $db = DB::db(); $connect=$db->get(); diff --git a/hwe/_admin1_submit.php b/hwe/_admin1_submit.php index 9a2c65de..82d7fc9a 100644 --- a/hwe/_admin1_submit.php +++ b/hwe/_admin1_submit.php @@ -29,6 +29,8 @@ $maxgeneral = Util::getReq('maxgeneral', 'int', GameConst::$defaultMaxGeneral); $maxnation = Util::getReq('maxnation', 'int', GameConst::$defaultMaxNation); $startyear = Util::getReq('startyear', 'int', GameConst::$defaultStartYear); +extractMissingPostToGlobals(); + $db = DB::db(); $connect=$db->get(); diff --git a/hwe/_admin2_submit.php b/hwe/_admin2_submit.php index fc568cc1..eead775e 100644 --- a/hwe/_admin2_submit.php +++ b/hwe/_admin2_submit.php @@ -7,6 +7,8 @@ include "func.php"; $btn = Util::getReq('btn'); $weap = Util::getReq('weap', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireLogin()->loginGame()->setReadOnly(); diff --git a/hwe/_admin4_submit.php b/hwe/_admin4_submit.php index 61b4e71c..19248da0 100644 --- a/hwe/_admin4_submit.php +++ b/hwe/_admin4_submit.php @@ -14,6 +14,8 @@ if($session->userGrade < 5) { $btn = Util::getReq('btn'); $genlist = Util::getReq('genlist', 'int'); +extractMissingPostToGlobals(); + $db = DB::db(); $connect=$db->get(); diff --git a/hwe/_admin5.php b/hwe/_admin5.php index e22c0b2f..c045a126 100644 --- a/hwe/_admin5.php +++ b/hwe/_admin5.php @@ -7,6 +7,8 @@ include "func.php"; $type = Util::getReq('type', 'int', 0); $type2 = Util::getReq('type2', 'int', 0); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); diff --git a/hwe/_admin5_submit.php b/hwe/_admin5_submit.php index b5fa892c..4a3c60c9 100644 --- a/hwe/_admin5_submit.php +++ b/hwe/_admin5_submit.php @@ -7,6 +7,8 @@ include "func.php"; $btn = Util::getReq('btn'); $nation = Util::getReq('nation', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/_admin6.php b/hwe/_admin6.php index 4daeaad0..9102e875 100644 --- a/hwe/_admin6.php +++ b/hwe/_admin6.php @@ -6,6 +6,8 @@ include "func.php"; $type = Util::getReq('type', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); diff --git a/hwe/_admin7.php b/hwe/_admin7.php index 7610e758..98e65466 100644 --- a/hwe/_admin7.php +++ b/hwe/_admin7.php @@ -8,6 +8,8 @@ $btn = Util::getReq('btn'); $gen = Util::getReq('gen', 'int', 0); $type = Util::getReq('type', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); diff --git a/hwe/_admin8.php b/hwe/_admin8.php index 3c3bded4..c31d991f 100644 --- a/hwe/_admin8.php +++ b/hwe/_admin8.php @@ -8,6 +8,8 @@ $btn = Util::getReq('btn'); $gen = Util::getReq('gen', 'int', 0); $type = Util::getReq('type', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index fb765ac1..92e1236b 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -6,6 +6,8 @@ include "func.php"; $btn = Util::getReq('btn'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/a_emperior.php b/hwe/a_emperior.php index b7e41e6a..c09d1205 100644 --- a/hwe/a_emperior.php +++ b/hwe/a_emperior.php @@ -6,6 +6,8 @@ include "func.php"; $select = Util::getReq('select', 'int', 0); +extractMissingPostToGlobals(); + $db = DB::db(); $connect=$db->get(); diff --git a/hwe/a_emperior2.php b/hwe/a_emperior2.php index 4f2996a0..eae1b186 100644 --- a/hwe/a_emperior2.php +++ b/hwe/a_emperior2.php @@ -6,6 +6,8 @@ include "func.php"; $select = Util::getReq('select', 'int', 0); +extractMissingPostToGlobals(); + $db = DB::db(); $connect=$db->get(); diff --git a/hwe/a_genList.php b/hwe/a_genList.php index 1b0a9dee..0de1c55e 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -6,6 +6,8 @@ include "func.php"; $type = Util::getReq('type', 'int', 9); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/a_history.php b/hwe/a_history.php index 8d4a42d9..14a2ff9c 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -6,6 +6,8 @@ include "func.php"; $btn = Util::getReq('btn'); $yearmonth = Util::getReq('yearmonth', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/a_npcList.php b/hwe/a_npcList.php index e120155a..09963a91 100644 --- a/hwe/a_npcList.php +++ b/hwe/a_npcList.php @@ -6,6 +6,8 @@ include "func.php"; $type = Util::getReq('type', 'int', 1); +extractMissingPostToGlobals(); + if($type <= 0 || $type > 8){ $type = 1; } diff --git a/hwe/b_auction.php b/hwe/b_auction.php index 8f584be9..9690c1ab 100644 --- a/hwe/b_auction.php +++ b/hwe/b_auction.php @@ -7,6 +7,8 @@ include "func.php"; $msg = Util::getReq('msg'); $msg2 = Util::getReq('msg2'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/b_battleCenter.php b/hwe/b_battleCenter.php index 89caa475..b0c0390c 100644 --- a/hwe/b_battleCenter.php +++ b/hwe/b_battleCenter.php @@ -12,6 +12,8 @@ $btn = Util::getReq('btn'); $gen = Util::getReq('gen', 'int', 0); $type = Util::getReq('type', 'int', 0); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index bbe29353..b509b2d0 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -6,6 +6,8 @@ include "func.php"; $citylist = Util::getReq('citylist', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/b_genList.php b/hwe/b_genList.php index 07565e93..24d4fdee 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -6,6 +6,8 @@ include "func.php"; $type = Util::getReq('type', 'int', 7); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/b_myCityInfo.php b/hwe/b_myCityInfo.php index 575fe3f8..26230074 100644 --- a/hwe/b_myCityInfo.php +++ b/hwe/b_myCityInfo.php @@ -6,6 +6,8 @@ include "func.php"; $type = Util::getReq('type', 'int', 10); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/b_myGenInfo.php b/hwe/b_myGenInfo.php index 8e28b10a..ebfb0448 100644 --- a/hwe/b_myGenInfo.php +++ b/hwe/b_myGenInfo.php @@ -6,6 +6,8 @@ include "func.php"; $type = Util::getReq('type', 'int', 1); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php index 409e515a..987610f8 100644 --- a/hwe/b_myPage.php +++ b/hwe/b_myPage.php @@ -9,6 +9,8 @@ $map = Util::getReq('map', 'int', 0); $mode = Util::getReq('mode', 'int', 2); $tnmt = Util::getReq('tnmt', 'int', 1); +extractMissingPostToGlobals(); + if($map < 0 && $map > 2){ $map = 0; } diff --git a/hwe/c_auction.php b/hwe/c_auction.php index 524c537b..460a95e6 100644 --- a/hwe/c_auction.php +++ b/hwe/c_auction.php @@ -24,6 +24,8 @@ $term = Util::getReq('term', 'int'); $stuff = Util::getReq('stuff', 'int'); $sel = Util::getReq('sel', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/c_betting.php b/hwe/c_betting.php index c8238d0a..6aa93e51 100644 --- a/hwe/c_betting.php +++ b/hwe/c_betting.php @@ -22,6 +22,11 @@ for($i=0;$i<16;$i++){ } } +if($betGold == -1){ + extractMissingPostToGlobals(); +} + + if($betTarget < 0 || $betGold < 10 || $betGold > 1000){ header('Location: b_betting.php'); exit(); diff --git a/hwe/c_chiefboard.php b/hwe/c_chiefboard.php index c089b9c0..43003760 100644 --- a/hwe/c_chiefboard.php +++ b/hwe/c_chiefboard.php @@ -10,6 +10,8 @@ $num = Util::getReq('num'); $reply = Util::getReq('reply'); // $title, $msg, $num +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/c_dipcenter.php b/hwe/c_dipcenter.php index 96f650f9..70d66542 100644 --- a/hwe/c_dipcenter.php +++ b/hwe/c_dipcenter.php @@ -12,6 +12,8 @@ $rate = Util::getReq('rate', 'int'); $bill = Util::getReq('bill', 'int'); $secretlimit = Util::getReq('secretlimit', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/c_double.php b/hwe/c_double.php index 97868cae..f80ac357 100644 --- a/hwe/c_double.php +++ b/hwe/c_double.php @@ -14,6 +14,8 @@ $double = Util::getReq('double', 'int', 0); $third = Util::getReq('third', 'int', 0); $fourth = Util::getReq('fourth', 'int', 0); +extractMissingPostToGlobals(); + if(!$turn){ $turn = [0]; } diff --git a/hwe/c_myBossInfo.php b/hwe/c_myBossInfo.php index ed166ef9..b149ddbb 100644 --- a/hwe/c_myBossInfo.php +++ b/hwe/c_myBossInfo.php @@ -11,6 +11,8 @@ $genlist = Util::getReq('genlist', 'int'); $outlist = Util::getReq('outlist', 'int'); $citylist = Util::getReq('citylist', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/c_nationboard.php b/hwe/c_nationboard.php index b76f046d..68a0b03f 100644 --- a/hwe/c_nationboard.php +++ b/hwe/c_nationboard.php @@ -8,6 +8,8 @@ $title = Util::getReq('title'); $msg = Util::getReq('msg'); $num = Util::getReq('num', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/c_nationrule.php b/hwe/c_nationrule.php index 26932a63..d142b112 100644 --- a/hwe/c_nationrule.php +++ b/hwe/c_nationrule.php @@ -6,6 +6,8 @@ include "func.php"; // $msg $msg = Util::getReq('msg'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/c_tournament.php b/hwe/c_tournament.php index 8173c19c..b240ff68 100644 --- a/hwe/c_tournament.php +++ b/hwe/c_tournament.php @@ -14,6 +14,8 @@ $gen = Util::getReq('gen', 'int'); $sel = Util::getReq('sel', 'int'); $trig = Util::getReq('trig', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/c_troop.php b/hwe/c_troop.php index 44c00b1a..94c6f5cf 100644 --- a/hwe/c_troop.php +++ b/hwe/c_troop.php @@ -8,6 +8,8 @@ $btn = Util::getReq('btn'); $name = Util::getReq('name'); $troop = Util::getReq('troop', 'int'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = $session::getUserID(); diff --git a/hwe/c_vote.php b/hwe/c_vote.php index ca6385b0..6fca9aab 100644 --- a/hwe/c_vote.php +++ b/hwe/c_vote.php @@ -10,6 +10,8 @@ $comment = Util::getReq('comment'); $title = Util::getReq('title'); $str = Util::getReq('str'); +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/d_ally.php b/hwe/d_ally.php index a5187102..a043c865 100644 --- a/hwe/d_ally.php +++ b/hwe/d_ally.php @@ -8,6 +8,8 @@ $ok = Util::getReq('ok'); $when = Util::getReq('when', 'int'); $gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;; +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/d_cancel.php b/hwe/d_cancel.php index 252a1548..838b17d5 100644 --- a/hwe/d_cancel.php +++ b/hwe/d_cancel.php @@ -7,6 +7,8 @@ include "func.php"; $ok = Util::getReq('ok'); $gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;; +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/d_cease.php b/hwe/d_cease.php index bce92012..bc017df2 100644 --- a/hwe/d_cease.php +++ b/hwe/d_cease.php @@ -7,6 +7,8 @@ include "func.php"; $ok = Util::getReq('ok'); $gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;; +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/d_merge.php b/hwe/d_merge.php index ece9105b..2a06b2f9 100644 --- a/hwe/d_merge.php +++ b/hwe/d_merge.php @@ -7,6 +7,8 @@ include "func.php"; $ok = Util::getReq('ok'); $gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;; +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/d_scout.php b/hwe/d_scout.php index 0b634d47..d40d32e8 100644 --- a/hwe/d_scout.php +++ b/hwe/d_scout.php @@ -12,6 +12,8 @@ include "func.php"; $gen = Util::getReq('gen', 'int'); +extractMissingPostToGlobals(); + $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); //FIXME: 망했음. CriticalFailure. 재 구현. diff --git a/hwe/d_surrender.php b/hwe/d_surrender.php index 4af69215..85c73d7f 100644 --- a/hwe/d_surrender.php +++ b/hwe/d_surrender.php @@ -7,6 +7,8 @@ include "func.php"; $ok = Util::getReq('ok'); $gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;; +extractMissingPostToGlobals(); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); diff --git a/hwe/j_install_db.php b/hwe/j_install_db.php index ee7ee67b..e104c449 100644 --- a/hwe/j_install_db.php +++ b/hwe/j_install_db.php @@ -19,6 +19,8 @@ $username = Util::getReq('db_id'); $password = Util::getReq('db_pw'); $dbName = Util::getReq('db_name'); +extractMissingPostToGlobals(); + if(!$host || !$port || !$username || !$password || !$dbName){ Json::die([ 'result'=>false, diff --git a/hwe/j_map_history.php b/hwe/j_map_history.php index f9075424..688cec7c 100644 --- a/hwe/j_map_history.php +++ b/hwe/j_map_history.php @@ -7,6 +7,8 @@ include "func.php"; $year = Util::getReq('year', 'int'); $month = Util::getReq('month', 'int'); +extractMissingPostToGlobals(); + $url = '/a_history.php'; if(!strpos($_SERVER['HTTP_REFERER'], $url)) { diff --git a/hwe/join_post.php b/hwe/join_post.php index a27dc090..c8c0f12e 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -53,6 +53,8 @@ $leader = Util::getReq('leader', 'int', 50); $power = Util::getReq('power', 'int', 50); $intel = Util::getReq('intel', 'int', 50); +extractMissingPostToGlobals(); + $rootDB = RootDB::db(); //회원 테이블에서 정보확인 $member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name` FROM MEMBER WHERE no=%i', $userID); diff --git a/hwe/lib.php b/hwe/lib.php index be4ac818..06251497 100644 --- a/hwe/lib.php +++ b/hwe/lib.php @@ -90,30 +90,33 @@ function LogText($prefix, $variable) file_put_contents(ROOT.'/d_log/dbg_logs.txt', $text, FILE_APPEND); } -function extractSuperGlobals() +function extractMissingPostToGlobals() { + $result = []; if (isset($_POST) && count($_POST) > 0) { - LogText($_SERVER['REQUEST_URI'], $_POST); + foreach($_POST as $key=>$val){ if(isset($GLOBALS[$key])){ continue; } + $result[$key]=$val; $GLOBALS[$key]=$val; } } if (isset($_GET) && count($_GET) > 0) { - LogText($_SERVER['REQUEST_URI'], $_GET); - foreach($_GET as $key=>$val){ if(isset($GLOBALS[$key])){ continue; } + $result[$key]=$val; $GLOBALS[$key]=$val; } } + + if($result){ + LogText($_SERVER['REQUEST_URI'], $result); + } + } - - -extractSuperGlobals(); diff --git a/hwe/preprocessing.php b/hwe/preprocessing.php index 2d50b058..3bc5ecb5 100644 --- a/hwe/preprocessing.php +++ b/hwe/preprocessing.php @@ -14,6 +14,8 @@ $turn = Util::getReq('turn', 'array_int'); $sel = Util::getReq('sel', 'int'); $commandtype = Util::getReq('commandtype', 'int'); +extractMissingPostToGlobals(); + increaseRefresh("턴입력", 1); if(!$turn || $commandtype === null){ diff --git a/hwe/processing.php b/hwe/processing.php index 54c77eac..86bec5a7 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -8,6 +8,8 @@ include "func.php"; $commandtype = Util::getReq('commandtype', 'int', 0); $turn = Util::getReq('turn', 'array_int', [0]); +extractMissingPostToGlobals(); + $session = Session::requireGameLogin()->setReadOnly(); $db = DB::db(); diff --git a/hwe/turn.php b/hwe/turn.php index d5ff9cc1..ee762f1a 100644 --- a/hwe/turn.php +++ b/hwe/turn.php @@ -8,6 +8,8 @@ include "func.php"; $type = Util::getReq('type', 'int', 0); $sel = Util::getReq('sel', 'int', 1); +extractMissingPostToGlobals(); + if($sel <= 0 || $sel > 12){ $sel = 1; }