From 97cf523c85569f9b08de3eeeef6574f30b9d45db Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sat, 27 May 2017 09:04:17 -0600 Subject: [PATCH] lower any mimetypes --- blueprints/config/media.yaml | 2 ++ classes/admin.php | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/blueprints/config/media.yaml b/blueprints/config/media.yaml index 89f37c4e..ba558680 100644 --- a/blueprints/config/media.yaml +++ b/blueprints/config/media.yaml @@ -24,6 +24,8 @@ form: .mime: type: text label: PLUGIN_ADMIN.MIME_TYPE + validate: + type: lower .image: type: textarea yaml: true diff --git a/classes/admin.php b/classes/admin.php index a0d3c019..f813ea48 100644 --- a/classes/admin.php +++ b/classes/admin.php @@ -574,6 +574,17 @@ class Admin return $data[$type]; } + protected function hasErrorMessage() + { + $msgs = $this->grav['messages']->all(); + foreach ($msgs as $msg) { + if (isset($msg['scope']) && $msg['scope'] === 'error') { + return true; + } + } + return false; + } + /** * Returns blueprints for the given type. *