From 9cda8b543db0aa983d3d21eced52a4ae95cea011 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Fri, 2 Jun 2023 11:42:23 +0100 Subject: [PATCH] Log successful cleanup --- wp-mat.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-mat.php b/wp-mat.php index c9c816a..d94b447 100644 --- a/wp-mat.php +++ b/wp-mat.php @@ -3,7 +3,7 @@ * Plugin Name: wp-mat * Plugin URI: https://git.autistici.org/noblogs/wp-mat * Description: Process uploaded files through MAT - * Version: 0.0.6 + * Version: 0.0.7 * Author: Autistici/Inventati * Author URI: https://www.autistici.org/ * License: MIT @@ -74,12 +74,14 @@ function wp_mat_handle_upload_prefilter($file) { $new_tmp_file = tempnam("", "wp_mat_"); if (wp_mat_issue_request($file['tmp_name'], $file['type'], $new_tmp_file)) { unlink($file['tmp_name']); - return array( + $new_file = array( "name" => $file['name'], "type" => $file['type'], "tmp_name" => $new_tmp_file, "size" => filesize($new_tmp_file), ); + error_log("wp-mat: successfully cleaned file=".json_encode($new_file)); + $file = $new_file; } else { error_log("wp-mat: server error for file=".json_encode($file)); @unlink($new_tmp_file); -- GitLab