diff options
Diffstat (limited to 'library/WT/Controller/Individual.php')
| -rw-r--r-- | library/WT/Controller/Individual.php | 7 |
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: |
