Skip to content
Snippets Groups Projects
Commit 9a3707c1 authored by ale's avatar ale
Browse files

Ensure WP_MAT_ENDPOINT is defined

parent daa1f050
No related branches found
No related tags found
No related merge requests found
Pipeline #54082 passed
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
* License URI: http://opensource.org/licenses/MIT * 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. // Check if the mime type is one of those we want to clean up.
function wp_mat_is_supported_mime_type($mimetype) { function wp_mat_is_supported_mime_type($mimetype) {
if (substr($mimetype, 0, 6) === "image/") { if (substr($mimetype, 0, 6) === "image/") {
...@@ -46,11 +50,12 @@ function wp_mat_issue_request($path, $mimetype, $output_path) { ...@@ -46,11 +50,12 @@ function wp_mat_issue_request($path, $mimetype, $output_path) {
return $ret; return $ret;
} }
function wp_mat_handle_upload_prefilter(&$file) { function wp_mat_handle_upload_prefilter($file) {
if (isset($file['error'])) { if (isset($file['error'])) {
return $file; return $file;
} }
if (!wp_mat_is_supported_mime_type($file['type'])) { if (!wp_mat_is_supported_mime_type($file['type'])) {
error_log("wp-mat: unsupported mime type ".$file['type']);
return $file; return $file;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment