Non-latin characters in surnames breaks sidebar indi/fam-list

Bug #789866 reported by fisharebest
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
webtrees
Fix Committed
Low
fisharebest

Bug Description

The individuals and families sidebar use the surname for several purposes.

As a CSS id:

<li id="sb_indi_'.$surname.'">

This generates invalid HTML when surnames contain non-latin characters, puncuation marks, etc. We need a unique identifier containing valid characters. md5($surname) would be ideal, but JavaScript does not have an md5() function.

As an HTML attribute:

<a href="'.$surname.'" title="'.$surname.'" alt="'.$alpha.'" class="sb_indi_surname">

This generates invalid HTML when the surname contains special characters. It needs to be escaped with htmlspecialchars(), but this will break the JavaScript - unless the JS implements an unhtmlentities() function.

To generate a URL:

url: "sidebar.php?sb_action=individuals&alpha="+alpha+"&surname="+surname

This generates invalid URLs when surnames contain special characters. The arguments need to be escaped with either JavaScript's escape() function or PHP's rawurlencode() function.

Changed in webtrees:
status: New → Confirmed
importance: Undecided → Low
Changed in webtrees:
status: Confirmed → Triaged
Changed in webtrees:
status: Triaged → Fix Committed
assignee: nobody → fisharebest (fisharebest)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.