summaryrefslogtreecommitdiff
path: root/app/Report/ReportParserGenerate.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-08-18 19:55:34 +0100
committerGreg Roach <fisharebest@webtrees.net>2018-08-18 19:55:34 +0100
commitfaffe0b0857786486c95615bb2beac0bed943f35 (patch)
treee8620bd0f1d30e3a3a749ec50fa8a3e9d75390c6 /app/Report/ReportParserGenerate.php
parent91493275e51276bc64fbf6977dfd7efffb276b6c (diff)
downloadwebtrees-faffe0b0857786486c95615bb2beac0bed943f35.tar.gz
webtrees-faffe0b0857786486c95615bb2beac0bed943f35.tar.bz2
webtrees-faffe0b0857786486c95615bb2beac0bed943f35.zip
Fix: #1495 - name shortening algorithm breaks many names - remove it.
Diffstat (limited to 'app/Report/ReportParserGenerate.php')
-rw-r--r--app/Report/ReportParserGenerate.php19
1 files changed, 1 insertions, 18 deletions
diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php
index d01f6727ba..edaafbc9e2 100644
--- a/app/Report/ReportParserGenerate.php
+++ b/app/Report/ReportParserGenerate.php
@@ -891,24 +891,7 @@ class ReportParserGenerate extends ReportParserBase
$name = strip_tags($name);
if (!empty($attrs['truncate'])) {
if (mb_strlen($name) > $attrs['truncate']) {
- $name = preg_replace("/\(.*\) ?/", '', $name); //removes () and text inbetween - what about ", [ and { etc?
- $words = preg_split('/[, -]+/', $name); // names separated with space, comma or hyphen - any others?
- $name = $words[count($words) - 1];
- for ($i = count($words) - 2; $i >= 0; $i--) {
- $len = mb_strlen($name);
- for ($j = count($words) - 3; $j >= 0; $j--) {
- $len += mb_strlen($words[$j]);
- }
- if ($len > $attrs['truncate']) {
- $first_letter = mb_substr($words[$i], 0, 1);
- // Do not show " of nick-names
- if ($first_letter != '"') {
- $name = mb_substr($words[$i], 0, 1) . '. ' . $name;
- }
- } else {
- $name = $words[$i] . ' ' . $name;
- }
- }
+ $name = mb_substr($name, 0, $attrs['truncate'] -1) . '…';
}
} else {
$addname = $record->getAddName();