From 3ec0f8a92b6281d4ec30140762e79b3963a0dda5 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Sun, 27 Nov 2005 22:40:03 +0000 Subject: [PATCH] Correctly get the MIME type from the MIME type table. --- lib/widgets/fieldsetDisplay.inc.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/widgets/fieldsetDisplay.inc.php b/lib/widgets/fieldsetDisplay.inc.php index 8641735..f33ca8c 100644 --- a/lib/widgets/fieldsetDisplay.inc.php +++ b/lib/widgets/fieldsetDisplay.inc.php @@ -112,13 +112,15 @@ class KTFieldsetDisplay { // FIXME lazy cache this. // FIXME extend mime_types to have something useful to say. $sQuery = 'SELECT mimetypes FROM mime_types WHERE id = ?'; - $res = DBUtil::getOneResult(array($sQuery, array($iMimeTypeId))); + $res = DBUtil::getOneResultKey(array($sQuery, array($iMimeTypeId)), 'mimetypes'); - if ($res[0] !== null) { - return $res[0]; - } else { - return 'unknown type'; + if (PEAR::isError($res)) { + return 'unknown type'; + } + if (empty($res)) { + return 'unknown type'; } + return $res; } -- libgit2 0.21.4