summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2014-01-24 21:48:05 +0000
committerGreg Roach <fisharebest@gmail.com>2014-01-24 21:48:05 +0000
commit316864a77b83c526d8d104c0de783e04926f5aa0 (patch)
treea1d5c46eb6d38c12a112dfb960b6a78085da249f
parent060c6e0e1da0d0b94115afc7c1d1d9711eae6ac9 (diff)
downloadwebtrees-316864a77b83c526d8d104c0de783e04926f5aa0.tar.gz
webtrees-316864a77b83c526d8d104c0de783e04926f5aa0.tar.bz2
webtrees-316864a77b83c526d8d104c0de783e04926f5aa0.zip
#1269075 - Names containing an apostrophe (') are displayed as Name (Name)
-rw-r--r--library/WT/Controller/Individual.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/library/WT/Controller/Individual.php b/library/WT/Controller/Individual.php
index 0be5725bf4..f47f332733 100644
--- a/library/WT/Controller/Individual.php
+++ b/library/WT/Controller/Individual.php
@@ -179,10 +179,11 @@ class WT_Controller_Individual extends WT_Controller_GedcomRecord {
case 'SURN':
// The SURN field is not necessarily the surname.
// Where it is not a substring of the real surname, show it after the real surname.
- if (strpos($primary_name['surname'], str_replace(',', ' ', $name))!==false) {
- echo $primary_name['surname'];
+ $surname = WT_Filter::escapeHtml($primary_name['surname']);
+ if (strpos($primary_name['surname'], str_replace(',', ' ', $nmatch[$i][2]))!==false) {
+ echo $surname;
} else {
- echo WT_I18N::translate('%1$s (%2$s)', $primary_name['surname'], $name);
+ echo WT_I18N::translate('%1$s (%2$s)', $surname, $name);
}
break;
default: