custom_css(); global $wpdb; $path = str_replace('\\', '/', ABSPATH); if (isset($_POST['submit']) && wp_verify_nonce(sanitize_text_field($_POST['wp_filemanager_root_nonce_field']), 'wp_filemanager_root_action')) { $directory_separators = ['../', './','..\\', '.\\', '..']; $public_path = isset($_POST['public_path']) ? str_replace($directory_separators, '', htmlentities(trim($path.$_POST['public_path']))): $path; $save_array = array( 'public_path' => $public_path, 'fm_enable_trash' => isset($_POST['fm_enable_trash']) ? intval($_POST['fm_enable_trash']) : '', 'fm_enable_media_upload' => isset($_POST['fm_enable_media_upload']) ? intval($_POST['fm_enable_media_upload']) : '', 'fm_max_packet_allowed' => isset($_POST['fm_max_packet_allowed']) ? intval($_POST['fm_max_packet_allowed']) : '', ); if(isset($_POST['fm_max_packet_allowed'])){ $fm_max_packet_allowed = intval($_POST['fm_max_packet_allowed']); $packet_value = intval($fm_max_packet_allowed * 1000000); if($packet_value <= 0 ){ $prev_value = get_option('wp_file_manager_settings',true); $packet_value = isset($prev_value['fm_max_packet_allowed']) ? intval($prev_value['fm_max_packet_allowed']) : 0; $save_array['fm_max_packet_allowed'] = $packet_value; $packet_value = intval($packet_value * 1000000); } else { $save_array['fm_max_packet_allowed'] = isset($packet_value) ? intval($packet_value/1000000) : ''; $set_packet_value = $wpdb->query($wpdb->prepare("SET GLOBAL max_allowed_packet = %d",$packet_value)); } } $save = update_option('wp_file_manager_settings', $save_array); if ($save) { mk_file_folder_manager::mk_fm_redirect('admin.php?page=wp_file_manager_preferences&status=1'); } else { mk_file_folder_manager::mk_fm_redirect('admin.php?page=wp_file_manager_preferences&status=2'); } } $settings = get_option('wp_file_manager_settings'); $max_allowed_packet = 'max_allowed_packet'; $packet_obj = $wpdb->get_row( $wpdb->prepare( "SHOW SESSION VARIABLES WHERE (variable_name = %s)", $max_allowed_packet ) ); $default_packet_value = intval($packet_obj->Value); $default_packet_value = intval($default_packet_value / 1000000); ?>

:

>

>