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

Ensure WP_MAT_ENDPOINT is defined

parent daa1f050
Branches
Tags v0.0.2
No related merge requests found
Pipeline #54082 passed
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment