Commit 3ec0f8a92b6281d4ec30140762e79b3963a0dda5
1 parent
dce7a112
Correctly get the MIME type from the MIME type table.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4216 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
7 additions
and
5 deletions
lib/widgets/fieldsetDisplay.inc.php
| ... | ... | @@ -112,13 +112,15 @@ class KTFieldsetDisplay { |
| 112 | 112 | // FIXME lazy cache this. |
| 113 | 113 | // FIXME extend mime_types to have something useful to say. |
| 114 | 114 | $sQuery = 'SELECT mimetypes FROM mime_types WHERE id = ?'; |
| 115 | - $res = DBUtil::getOneResult(array($sQuery, array($iMimeTypeId))); | |
| 115 | + $res = DBUtil::getOneResultKey(array($sQuery, array($iMimeTypeId)), 'mimetypes'); | |
| 116 | 116 | |
| 117 | - if ($res[0] !== null) { | |
| 118 | - return $res[0]; | |
| 119 | - } else { | |
| 120 | - return 'unknown type'; | |
| 117 | + if (PEAR::isError($res)) { | |
| 118 | + return 'unknown type'; | |
| 119 | + } | |
| 120 | + if (empty($res)) { | |
| 121 | + return 'unknown type'; | |
| 121 | 122 | } |
| 123 | + return $res; | |
| 122 | 124 | } |
| 123 | 125 | |
| 124 | 126 | ... | ... |