Skip to content

Commit

Permalink
Handle uninitialised variable and ú
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jul 18, 2024
1 parent 04a8baa commit 4f15cd6
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -2417,7 +2417,7 @@ sub print_person
$event = $e;
}
}
if((ref($event) eq 'Gedcom::Record') &&
if($event->can('type') && defined($event->type()) &&
($event->type() eq 'Custom Marriage')) {
# FindMyPast
$marriage = $event;
Expand Down Expand Up @@ -6289,13 +6289,13 @@ sub print_person
$phrase->append(lcfirst($pronoun));
}
$phrase->append(i18n({ person => $person, format => ' arrived' }));
if(my $p = place({ person => $person, record => $events[0] })) {
if(my $p = place({ person => $person, record => $event })) {
$bio .= $p;
$phrase->append($p);
} else {
complain({ person => $person, warning => 'Arrival record has no place' });
}
if(my $y = year({ person => $person, record => $events[0] })) {
if(my $y = year({ person => $person, record => $event })) {
$bio .= " $y";
$phrase->append(" $y");
} else {
Expand Down Expand Up @@ -6369,10 +6369,12 @@ sub print_person
} else {
$place =~ s/^\sin/ from/;
}
$bio .= "$place " .
year({ person => $person, record => $events[0] });
$phrase->append("$place " .
year({ person => $person, record => $events[0] }));
$bio .= $place;
$phrase->append($place);
if(my $date = year({ person => $person, record => $event })) {
$bio .= " $date";
$phrase->append(" $date");
}
if(my $notes = notes({ record => $event, note_locations => \@note_locations })) {
$notes = lcfirst($notes);
$bio .= " ($notes)";
Expand Down Expand Up @@ -14324,6 +14326,7 @@ sub wide_to_html
$string =~ s/\xc3\xa9/é/g;
$string =~ s/\xc3\xad/í/g; # í
$string =~ s/\xc3\xb0/ð/g; # ð
$string =~ s/\xc3\xba/ú/g; # ú
$string =~ s/\xc3\xb4/ô/g; # ô
$string =~ s/\xc3\xb6/ö/g;
$string =~ s/\xc3\xb8/ø/g; # ø
Expand Down Expand Up @@ -14381,6 +14384,7 @@ sub wide_to_html
$string =~ s/\N{U+00F4}/ô/g; # ô
$string =~ s/\N{U+00F6}/ö/g;
$string =~ s/\N{U+00F8}/ø/g; # ø
$string =~ s/\N{U+00FA}/ú/g; # ú
$string =~ s/\N{U+00FC}/ü/g; # ü
$string =~ s/\N{U+00FE}/þ/g; # þ
$string =~ s/\N{U+00C1}/Á/g; # Á
Expand Down Expand Up @@ -14471,6 +14475,7 @@ sub wide_to_html
$string =~ s/þ/þ/g;
$string =~ s/û/û/g;
$string =~ s/ü/ü/g;
$string =~ s/ú/ú/g;
$string =~ s/£/£/g;
$string =~ s/ß/ß/g;
$string =~ s/–/–/g;
Expand Down Expand Up @@ -14582,6 +14587,7 @@ sub wide_to_xml
$string =~ s/î/î/g;
$string =~ s/ï/ï/g; # ï
$string =~ s/ð/ð/g; # ð
$string =~ s/ú/&#0FA;/g; # ú
$string =~ s/ü/ü/g;
$string =~ s/š/š/g;
$string =~ s/û/ô/g;
Expand Down Expand Up @@ -14641,6 +14647,7 @@ sub wide_to_xml
$string =~ s/\xc3\x89/É/g;
$string =~ s/\xc3\xaa/ê/g;
$string =~ s/\xc3\xab/ë/g; # eumlaut
$string =~ s/\xc3\xba/ú/g; # ú
$string =~ s/\xc3\xbb/»/g; # û - ucirc
$string =~ s/\xc5\x9b/ś/g; # ś - sacute
$string =~ s/\xc5\xa0/Š/g;
Expand Down Expand Up @@ -14682,6 +14689,7 @@ sub wide_to_xml
$string =~ s/\N{U+00F4}/ô/g; # ô
$string =~ s/\N{U+00F6}/ö/g; # ö
$string =~ s/\N{U+00F8}/ø/g; # ø
$string =~ s/\N{U+00FA}/ú/g; # ú
$string =~ s/\N{U+00FC}/ü/g; # ü
$string =~ s/\N{U+015B}/ś/g; # ś
# print STDERR __LINE__, ": ($string)";
Expand Down Expand Up @@ -14754,6 +14762,7 @@ sub wide_to_xml
$string =~ s/ø/ø/g; # ø
$string =~ s/û/û/g;
$string =~ s/ñ/ñ/g;
$string =~ s/ú/ú/g;
$string =~ s/ü/ü/g;
$string =~ s/þ/þ/g; # þ
$string =~ s/[“”«»]/"/g;
Expand Down

0 comments on commit 4f15cd6

Please sign in to comment.