From 90e1d7f65690a7e14e5ac530357ef73eca33fb42 Mon Sep 17 00:00:00 2001 From: fisharebest Date: Fri, 5 Jul 2013 18:40:20 +0000 Subject: More refactoring - getMediaType() --- library/WT/Media.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/WT/Media.php b/library/WT/Media.php index 4a5cbb855f..bd4e93d899 100644 --- a/library/WT/Media.php +++ b/library/WT/Media.php @@ -240,13 +240,13 @@ class WT_Media extends WT_GedcomRecord { return ($etag_string); } - /** - * get the media type from the gedcom - * @return string - */ + // TODO Deprecated? This does not need to be a function here. public function getMediaType() { - $mediaType = strtolower(get_gedcom_value('FORM:TYPE', 2, $this->getGedcom())); - return $mediaType; + if (preg_match('\n\d TYPE (.+)', $this->gedcom, $match)) { + return strtolower($match[1]); + } else { + return ''; + } } // Is this object marked as a highlighted image? -- cgit v1.3