diff options
| author | fisharebest <fisharebest@gmail.com> | 2013-07-05 18:40:20 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2013-07-05 18:40:20 +0000 |
| commit | 90e1d7f65690a7e14e5ac530357ef73eca33fb42 (patch) | |
| tree | 13bed008d58958eb1d5dfd0c5b89b370ac2cba72 | |
| parent | d4b4e3d3cd234eae776dd55e8e2172c377dad309 (diff) | |
| download | webtrees-90e1d7f65690a7e14e5ac530357ef73eca33fb42.tar.gz webtrees-90e1d7f65690a7e14e5ac530357ef73eca33fb42.tar.bz2 webtrees-90e1d7f65690a7e14e5ac530357ef73eca33fb42.zip | |
More refactoring - getMediaType()
| -rw-r--r-- | library/WT/Media.php | 12 |
1 files 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? |
