From: Lukas Reschke Date: Fri, 9 Jan 2015 01:31:59 +0000 (+0100) Subject: Verify existence of $_GET key X-Git-Tag: v8.0.0alpha2~22^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=199276bcbb820df518298d2d98c9b00711c1be38;p=nextcloud-server.git 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. --- diff --git a/apps/files/ajax/mimeicon.php b/apps/files/ajax/mimeicon.php index fdbcc441a78..c531f5a3e81 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);