From 199276bcbb820df518298d2d98c9b00711c1be38 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 9 Jan 2015 02:31:59 +0100 Subject: [PATCH] Verify existence of $_GET key Otherwise when the file without any specified mimetype was accessed the error log was flooded with entries such as "Undefined index: mime", there can be multiple issues found about this in the forum and our bugtracker. To test this access `/index.php/apps/files/ajax/mimeicon.php` with and without `$_GET['mime']`. Fixes itself. --- apps/files/ajax/mimeicon.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/files/ajax/mimeicon.php b/apps/files/ajax/mimeicon.php index fdbcc441a7..c531f5a3e8 100644 --- a/apps/files/ajax/mimeicon.php +++ b/apps/files/ajax/mimeicon.php @@ -1,4 +1,6 @@ getSession()->close(); -print OC_Helper::mimetypeIcon($_GET['mime']); +$mime = isset($_GET['mime']) ? $_GET['mime'] : ''; + +print OC_Helper::mimetypeIcon($mime);