diff --git a/library/PhpGedcom/Parser/Indi/Attr.php b/library/PhpGedcom/Parser/Indi/Attr.php index 4aa99a48..99cad602 100644 --- a/library/PhpGedcom/Parser/Indi/Attr.php +++ b/library/PhpGedcom/Parser/Indi/Attr.php @@ -40,7 +40,6 @@ public static function parse(\PhpGedcom\Parser $parser) return null; } - if (isset($record[2])) { $attr->setAttr(trim($record[2])); } diff --git a/library/PhpGedcom/Parser/Indi/Even.php b/library/PhpGedcom/Parser/Indi/Even.php index 77cdd2e1..988c2c1e 100644 --- a/library/PhpGedcom/Parser/Indi/Even.php +++ b/library/PhpGedcom/Parser/Indi/Even.php @@ -49,6 +49,11 @@ public static function parse(\PhpGedcom\Parser $parser) $even->setType(trim($record[1])); } + // ensures we capture any data following the EVEN type + if (isset($record[2]) && !empty($record[2])) { + $even->setAttr(trim($record[2])); + } + $parser->forward(); while (!$parser->eof()) { diff --git a/library/PhpGedcom/Record/Indi/Even.php b/library/PhpGedcom/Record/Indi/Even.php index 47335135..646b2aa8 100644 --- a/library/PhpGedcom/Record/Indi/Even.php +++ b/library/PhpGedcom/Record/Indi/Even.php @@ -27,6 +27,11 @@ class Even extends Record implements Record\Objectable, Record\Sourceable, Recor */ protected $type; + /** + * @var string + */ + protected $_attr; + /** * @var string */