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.
This commit is contained in:
Lukas Reschke 2015-01-09 02:31:59 +01:00
parent 6a5f12beca
commit 199276bcbb
1 changed files with 3 additions and 1 deletions

View 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);