diff options
| author | fisharebest <fisharebest@gmail.com> | 2013-07-07 10:34:05 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2013-07-07 10:34:05 +0000 |
| commit | c01bde44028cd21e0bca5092d87c81889da8c54c (patch) | |
| tree | f1d9c5e3c09228387eb2621be6e75c2e9e057ed5 | |
| parent | 65df43b71780855fe23c627316c286df45f57be1 (diff) | |
| download | webtrees-c01bde44028cd21e0bca5092d87c81889da8c54c.tar.gz webtrees-c01bde44028cd21e0bca5092d87c81889da8c54c.tar.bz2 webtrees-c01bde44028cd21e0bca5092d87c81889da8c54c.zip | |
Use the actual XREF from the record, not the one used to find the record (e.g. i123 versus I123)
| -rw-r--r-- | library/WT/GedcomRecord.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/library/WT/GedcomRecord.php b/library/WT/GedcomRecord.php index f3ca4c2774..4dca149b37 100644 --- a/library/WT/GedcomRecord.php +++ b/library/WT/GedcomRecord.php @@ -134,19 +134,17 @@ class WT_GedcomRecord { $pending = null; } - // No such record exists - create a dummy one + // No such record exists if ($gedcom === null && $pending === null) { - // Is this a good idea? - //$xref = self::DUMMY_XREF; - //$gedcom = "0 @$xref@ " . static::RECORD_TYPE . "\n1 RESN none"; - //$gedcom_id = 0; return null; } // Create the object - if (preg_match('/^0 @' . WT_REGEX_XREF . '@ (' . WT_REGEX_TAG . ')/', $gedcom.$pending, $match)) { - $type = $match[1]; + if (preg_match('/^0 @(' . WT_REGEX_XREF . ')@ (' . WT_REGEX_TAG . ')/', $gedcom.$pending, $match)) { + $xref = $match[1]; // Collation - we may have requested I123 and found i123 + $type = $match[2]; } elseif (preg_match('/^0 (HEAD|TRLR)/', $gedcom.$pending, $match)) { + $xref = $match[1]; $type = $match[1]; } else { throw new Exception('Unrecognised GEDCOM record: ' . $gedcom); |
