summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/WT/GedcomRecord.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/library/WT/GedcomRecord.php b/library/WT/GedcomRecord.php
index e19fa9ab52..8b8ff79d8c 100644
--- a/library/WT/GedcomRecord.php
+++ b/library/WT/GedcomRecord.php
@@ -865,10 +865,10 @@ class WT_GedcomRecord {
// Replace a fact with a new gedcom data.
public function updateFact($fact_id, $gedcom, $update_chan) {
- if (strpos("\r", $gedcom)!==false) {
- // MSDOS line endings will break things in horrible ways
- throw new Exception('Evil line endings found in WT_GedcomRecord::updateFact(' . $gedcom . ')');
- }
+ // MSDOS line endings will break things in horrible ways
+ $gedcom = preg_replace('/[\r\n]+/', "\n", $gedcom);
+ $gedcom = trim($gedcom);
+
if ($this->pending==='') {
throw new Exception('Cannot edit a deleted record');
}
@@ -978,10 +978,9 @@ class WT_GedcomRecord {
}
public function updateRecord($gedcom, $update_chan) {
- if (strpos("\r", $gedcom)!==false) {
- // MSDOS line endings will break things in horrible ways
- throw new Exception('Evil line endings found in WT_GedcomRecord::updateRecord(' . $gedcom . ')');
- }
+ // MSDOS line endings will break things in horrible ways
+ $gedcom = preg_replace('/[\r\n]+/', "\n", $gedcom);
+ $gedcom = trim($gedcom);
// Update the CHAN record
if ($update_chan) {