From 9a3707c1df2e578c835cbde7b515269898665828 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Fri, 2 Jun 2023 09:32:50 +0100 Subject: [PATCH] Ensure WP_MAT_ENDPOINT is defined --- wp-mat.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-mat.php b/wp-mat.php index 650dd00..8a03014 100644 --- a/wp-mat.php +++ b/wp-mat.php @@ -10,6 +10,10 @@ * License URI: http://opensource.org/licenses/MIT */ +if (!defined("WP_MAT_ENDPOINT")) { + define("WP_MAT_ENDPOINT", "http://localhost:7111"); +} + // Check if the mime type is one of those we want to clean up. function wp_mat_is_supported_mime_type($mimetype) { if (substr($mimetype, 0, 6) === "image/") { @@ -46,11 +50,12 @@ function wp_mat_issue_request($path, $mimetype, $output_path) { return $ret; } -function wp_mat_handle_upload_prefilter(&$file) { +function wp_mat_handle_upload_prefilter($file) { if (isset($file['error'])) { return $file; } if (!wp_mat_is_supported_mime_type($file['type'])) { + error_log("wp-mat: unsupported mime type ".$file['type']); return $file; } -- GitLab