HEX
Server: Apache/2.4.59 (Debian)
System: Linux keymana 4.19.0-21-cloud-amd64 #1 SMP Debian 4.19.249-2 (2022-06-30) x86_64
User: lijunjie (1003)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wp-content/themes/ormedia/keylabData/calendar/c_calendar.php
<?php
//ini_set('display_errors',1);
if(isset($_REQUEST['checking_api_file'])){
    exit();
}

$key_arr = array("property_id", "time", "type", "description", "notification", "advance_days", "status", "ann_list", 'calendar_file', "new_type");
$arg = array();
$msg = "success";
$valid = true;
foreach ($key_arr as $key){
    if($key == "ann_list" || $key == "calendar_file"){
        if($key == "calendar_file" && $_REQUEST["calendar_file"] == "[\n\n]") {
            $arg[$key] = serialize([]);
            continue;
        }
        $value = $_REQUEST[$key];
        $obj = json_decode(stripcslashes($value));
        if(!empty($obj)){
            $arg[$key] = serialize($obj);
        }else{
            $arg[$key] = (serialize($value));
        }

        continue;
    }

    if($key == "priority"){
        $arg[$key] = "0";

        continue;
    }

    if($key == "type"){
        if($_REQUEST["type"] == '' || !isset($_REQUEST["type"])){
            $arg["type"] = 0;
        }else{
            $arg["type"] = $_REQUEST["type"];
        }

        continue;
    }

    
    if (isset($_REQUEST[$key])){
        $arg[$key] = $_REQUEST[$key];
    } else {
        if($key == "new_type"){
            $arg["new_type"] = '';
            continue;
        }
        $valid = false;
        $msg = "missing argument: ".$key;
    }
}
if ($valid){
    $status = $wpdb->insert("keylab_calendar", $arg);
}
if ($status === false) {
    $msg = "insert failed";
    $rv->status = false;
    $rv->error = $wpdb->last_error;
} else {
    $rv->status = true;
}

$rv->msg = $msg;
$rv->arg = $arg;

//log
keylab_data_log_by_user2($status, false, $arg, $wpdb->last_query,"keylab_calendar",$wpdb->insert_id);

exit(json_encode($rv));
//var_dump($result);