]> source.dussan.org Git - nextcloud-server.git/commitdiff
Verify existence of $_GET key
authorLukas Reschke <lukas@owncloud.com>
Fri, 9 Jan 2015 01:31:59 +0000 (02:31 +0100)
committerLukas Reschke <lukas@owncloud.com>
Fri, 9 Jan 2015 01:31:59 +0000 (02:31 +0100)
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

index fdbcc441a7844eeaab32b0220e8c037dfbaffc8b..c531f5a3e81d89e26abd032885a08fb51c2b2131 100644 (file)
@@ -1,4 +1,6 @@
 <?php
 \OC::$server->getSession()->close();
 
-print OC_Helper::mimetypeIcon($_GET['mime']);
+$mime = isset($_GET['mime']) ? $_GET['mime'] : '';
+
+print OC_Helper::mimetypeIcon($mime);