From 316864a77b83c526d8d104c0de783e04926f5aa0 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 24 Jan 2014 21:48:05 +0000 Subject: #1269075 - Names containing an apostrophe (') are displayed as Name (Name) --- library/WT/Controller/Individual.php | 7 ++++--- 1 file 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: -- cgit v1.3