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/u_calendar.php
<?php
//ini_set('display_errors',1);
if(isset($_REQUEST['checking_api_file'])){
    exit();
}

$key_arr = array("property_id", "time", "priority", "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"){
        $value = $_REQUEST[$key];
        $obj = json_decode(stripslashes($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];
    }
}
$arg['is_send'] = 0;
if (isset($_REQUEST['calendar_id'])){
    $id = $_REQUEST['calendar_id'];
} else if (isset($_REQUEST['id'])){
    $id = $_REQUEST['id'];
} else {
    $valid = false;
}
if ($valid){
    $old_data = $wpdb->get_results("select * from keylab_calendar where id = ".$id);

    $status = $wpdb->update("keylab_calendar", $arg, array('id'=>$id));
}
if ($status == false) {
    $msg = "update failed";
    $rv->status = false;
    $rv->last_error = $wpdb->last_error;
    $rv->last_query = $wpdb->last_query;
} else {
    $rv->status = true;
}

$rv->msg = $msg;

//log
keylab_data_log_by_user2($status, $old_data[0], $arg, $wpdb->last_query, "keylab_calendar", $id);

exit(json_encode($rv));

//var_dump($result);