diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-12-13 11:43:29 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-12-13 11:43:29 +0000 |
| commit | 9586c1e49dfc72375867ccdfa97169553c441dd2 (patch) | |
| tree | e123da42d58b78c31c63fac89802888ec5b33b75 /app/Http/RequestHandlers/CreateSourceAction.php | |
| parent | 7c53d505e496fcd3256dda24fb8b24445051a393 (diff) | |
| download | webtrees-9586c1e49dfc72375867ccdfa97169553c441dd2.tar.gz webtrees-9586c1e49dfc72375867ccdfa97169553c441dd2.tar.bz2 webtrees-9586c1e49dfc72375867ccdfa97169553c441dd2.zip | |
Fix: #2873 - wrong CONT tags when creating source with multi-line text
Diffstat (limited to 'app/Http/RequestHandlers/CreateSourceAction.php')
| -rw-r--r-- | app/Http/RequestHandlers/CreateSourceAction.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/Http/RequestHandlers/CreateSourceAction.php b/app/Http/RequestHandlers/CreateSourceAction.php index e76fbfceaf..a3f8621ffe 100644 --- a/app/Http/RequestHandlers/CreateSourceAction.php +++ b/app/Http/RequestHandlers/CreateSourceAction.php @@ -61,12 +61,9 @@ class CreateSourceAction implements RequestHandlerInterface $repository = trim(preg_replace('/\s+/', ' ', $repository)); $call_number = trim(preg_replace('/\s+/', ' ', $call_number)); - // Convert line endings to GEDDCOM continuations - $text = str_replace([ - "\r\n", - "\r", - "\n", - ], "\n1 CONT ", $text); + // Convert line endings to GEDCOM continuations + $text = strtr($text, ["\r\n" => "\n"]); + $text = strtr($text, ["\n" => "\n2 CONT "]); $gedcom = "0 @@ SOUR\n\n1 TITL " . $title; |
