summaryrefslogtreecommitdiff
path: root/library/WT/GedcomRecord.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-08-21 08:14:30 +0100
committerGreg Roach <fisharebest@gmail.com>2013-08-21 08:19:33 +0100
commit3ece0d9a474f61998ee49a8e897344c710dbaea2 (patch)
treeb813bc9b8cea0fca04f8285c03faff88f4b5392f /library/WT/GedcomRecord.php
parentf6aa3f1707ff0bc8ecd9d2dfb7355fe461504451 (diff)
downloadwebtrees-3ece0d9a474f61998ee49a8e897344c710dbaea2.tar.gz
webtrees-3ece0d9a474f61998ee49a8e897344c710dbaea2.tar.bz2
webtrees-3ece0d9a474f61998ee49a8e897344c710dbaea2.zip
Fix error displaying records with pending creation AND deletion
Fix error displaying records with pending creation AND deletion
Diffstat (limited to 'library/WT/GedcomRecord.php')
-rw-r--r--library/WT/GedcomRecord.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/WT/GedcomRecord.php b/library/WT/GedcomRecord.php
index 0c299f20ba..2857e4da88 100644
--- a/library/WT/GedcomRecord.php
+++ b/library/WT/GedcomRecord.php
@@ -149,8 +149,11 @@ class WT_GedcomRecord {
} elseif (preg_match('/^0 (HEAD|TRLR)/', $gedcom.$pending, $match)) {
$xref = $match[1];
$type = $match[1];
- } else {
+ } elseif ($gedcom.$pending) {
throw new Exception('Unrecognised GEDCOM record: ' . $gedcom);
+ } else {
+ // A record with both pending creation and pending deletion
+ $type = static::RECORD_TYPE;
}
switch($type) {
@@ -176,6 +179,7 @@ class WT_GedcomRecord {
case 'TRLR':
case 'SUBM':
case 'SUBN':
+ case 'UNKNOWN':
$record = new WT_GedcomRecord($xref, $gedcom, $pending, $gedcom_id);
break;
default: