Checked PSR-1 / PHP 8.1 Undefiend Varialbe, Type error

This commit is contained in:
kjh
2022-05-31 05:53:49 +00:00
parent 993e689800
commit 1fb9b5051c
13 changed files with 1011 additions and 967 deletions

View File

@ -1,60 +1,62 @@
<?php
$sub_menu = "200900";
include_once('./_common.php');
require_once './_common.php';
$w = $_POST['w'];
if ($w == 'u' || $w == 'd')
if ($w == 'u' || $w == 'd') {
check_demo();
}
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$check_keys = array(
'po_subject',
'po_poll1',
'po_poll2',
'po_poll3',
'po_poll4',
'po_poll5',
'po_poll6',
'po_poll7',
'po_poll8',
'po_poll9',
'po_cnt1',
'po_cnt2',
'po_cnt3',
'po_cnt4',
'po_cnt5',
'po_cnt6',
'po_cnt7',
'po_cnt8',
'po_cnt9',
'po_etc',
'po_level',
'po_point',
'po_id'
'po_subject',
'po_poll1',
'po_poll2',
'po_poll3',
'po_poll4',
'po_poll5',
'po_poll6',
'po_poll7',
'po_poll8',
'po_poll9',
'po_cnt1',
'po_cnt2',
'po_cnt3',
'po_cnt4',
'po_cnt5',
'po_cnt6',
'po_cnt7',
'po_cnt8',
'po_cnt9',
'po_etc',
'po_level',
'po_point',
'po_id'
);
foreach( $_POST as $key=>$value ){
if( empty($value) ) continue;
foreach ($_POST as $key => $value) {
if (empty($value)) {
continue;
}
if( in_array($key, $check_keys) ) {
if (in_array($key, $check_keys)) {
$_POST[$key] = strip_tags(clean_xss_attributes($value));
}
}
if ($w == '')
{
$po_id = isset($_POST['po_id']) ? $_POST['po_id'] : '';
if ($w == '') {
$sql = " insert {$g5['poll_table']}
( po_subject, po_poll1, po_poll2, po_poll3, po_poll4, po_poll5, po_poll6, po_poll7, po_poll8, po_poll9, po_cnt1, po_cnt2, po_cnt3, po_cnt4, po_cnt5, po_cnt6, po_cnt7, po_cnt8, po_cnt9, po_etc, po_level, po_point, po_date )
values ( '{$_POST['po_subject']}', '{$_POST['po_poll1']}', '{$_POST['po_poll2']}', '{$_POST['po_poll3']}', '{$_POST['po_poll4']}', '{$_POST['po_poll5']}', '{$_POST['po_poll6']}', '{$_POST['po_poll7']}', '{$_POST['po_poll8']}', '{$_POST['po_poll9']}', '{$_POST['po_cnt1']}', '{$_POST['po_cnt2']}', '{$_POST['po_cnt3']}', '{$_POST['po_cnt4']}', '{$_POST['po_cnt5']}', '{$_POST['po_cnt6']}', '{$_POST['po_cnt7']}', '{$_POST['po_cnt8']}', '{$_POST['po_cnt9']}', '{$_POST['po_etc']}', '{$_POST['po_level']}', '{$_POST['po_point']}', '".G5_TIME_YMD."' ) ";
values ( '{$_POST['po_subject']}', '{$_POST['po_poll1']}', '{$_POST['po_poll2']}', '{$_POST['po_poll3']}', '{$_POST['po_poll4']}', '{$_POST['po_poll5']}', '{$_POST['po_poll6']}', '{$_POST['po_poll7']}', '{$_POST['po_poll8']}', '{$_POST['po_poll9']}', '{$_POST['po_cnt1']}', '{$_POST['po_cnt2']}', '{$_POST['po_cnt3']}', '{$_POST['po_cnt4']}', '{$_POST['po_cnt5']}', '{$_POST['po_cnt6']}', '{$_POST['po_cnt7']}', '{$_POST['po_cnt8']}', '{$_POST['po_cnt9']}', '{$_POST['po_etc']}', '{$_POST['po_level']}', '{$_POST['po_point']}', '" . G5_TIME_YMD . "' ) ";
sql_query($sql);
$po_id = sql_insert_id();
}
else if ($w == 'u')
{
} elseif ($w == 'u') {
$sql = " update {$g5['poll_table']}
set po_subject = '{$_POST['po_subject']}',
po_poll1 = '{$_POST['po_poll1']}',
@ -80,9 +82,7 @@ else if ($w == 'u')
po_point = '{$_POST['po_point']}'
where po_id = '{$_POST['po_id']}' ";
sql_query($sql);
}
else if ($w == 'd')
{
} elseif ($w == 'd') {
$sql = " delete from {$g5['poll_table']} where po_id = '{$_POST['po_id']}' ";
sql_query($sql);
@ -96,7 +96,8 @@ else if ($w == 'd')
$row = sql_fetch(" select max(po_id) as max_po_id from {$g5['poll_table']} ");
sql_query(" update {$g5['config_table']} set cf_max_po_id = '{$row['max_po_id']}' ");
if ($w == 'd')
goto_url('./poll_list.php?'.$qstr);
else
goto_url('./poll_form.php?w=u&po_id='.$po_id.'&amp;'.$qstr);
if ($w == 'd') {
goto_url('./poll_list.php?' . $qstr);
} else {
goto_url('./poll_form.php?w=u&po_id=' . $po_id . '&amp;' . $qstr);
}