From cd294ea5fb1a03fb4355d26c24ef118566b6be72 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Fri, 2 Jun 2023 09:56:46 +0100
Subject: [PATCH] Added more debugging

---
 wp-mat.php | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/wp-mat.php b/wp-mat.php
index 4b9d8bd..64eb8b2 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.1
+ * Version: 0.0.4
  * Author: Autistici/Inventati
  * Author URI: https://www.autistici.org/
  * License: MIT
@@ -51,7 +51,10 @@ function wp_mat_issue_request($path, $mimetype, $output_path) {
 }
 
 function wp_mat_handle_upload_prefilter($file) {
-    if (isset($file['error'])) {
+    error_log("wp-mat: called with file=".json_encode($file));
+
+    if (isset($file['error']) && $file['error']) {
+        error_log("wp-mat: upload has error set to ".$file['error']);
         return $file;
     }
 
-- 
GitLab