vesta-webtrees-2-custom-modules / vesta_classic_laf

Vesta Classic Look & Feel (Webtrees 2 Custom Module)
https://cissee.de/
GNU General Public License v3.0
17 stars 2 forks source link

Bad nickname handling #115

Closed magicsunday closed 1 year ago

magicsunday commented 1 year ago

I got an error message that the my chart module (#https://github.com/magicsunday/webtrees-pedigree-chart/issues/53) could not be rendered correctly. It was now quite a headache to track down the error. However, I was able to narrow it down to your module. If the option "Display nicknames before surnames" is activated, the IndividualExt.php generates incorrect HTML.

I add a var_dump($full); at line 169 and the other one at line 175. This produces the following output:

/var/www/html/modules_v4/vesta_classic_laf/patchedWebtrees/IndividualExt.php:169:string 'Bernardo "Ti Bernat de la Viuda / Ti Bernat de la Cometa" /Bañuls Crespo/' (length=74)

/var/www/html/modules_v4/vesta_classic_laf/patchedWebtrees/IndividualExt.php:175:string '<span class="NAME" dir="auto" translate="no">Bernardo &quot;Ti Bernat de la Viuda <span class="SURN"> Ti Bernat de la Cometa&quot; </span>Bañuls Crespo/</span>' (length=160)

As you can see is one of the "@quot;" inside the "SURN"-span element. So after calling the "preg_replace_callback" at line 176 the final name looks like this:

<span class="NAME" dir="auto" translate="no">Bernardo <q class="wt-nickname">Ti Bernat de la Viuda <span class="SURN"> Ti Bernat de la Cometa</q> </span>Bañuls Crespo/</span>

The nickname short quotation is composed wrong and the surname span element gets invalid.

ric2016 commented 1 year ago

Thanks for reporting and investigating - The slash in the nickname isn't handled properly. I'll fix this shortly.

ric2016 commented 1 year ago

Fixed in Vesta release 2.1.16.0.0.