From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] dns.cgi: Fixes bug#12395 - German umlauts not correctly displayed in remarks Date: Wed, 28 Feb 2024 14:35:26 +0100 Message-ID: <20240228133526.6757-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0798363261053927287==" List-Id: --===============0798363261053927287== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - If Freifunk M=C3=BCnchen e.V. is entered as a remark it gets converted to Freifunk M=C3=83=C2=BCnchen e.V. - This is because cleanhtml is used on the remark text before saving it to th= e file and the HTML::Entities::encode_entities command that is run on that remark tex= t encodes all higher bit characters as unsafe characters and replaces them with their HT= ML entity representation. - Have tested out the remark with a range of different characters with diacri= tical marks and all of the ones tested were re-written. - The use of the cleanhtml makes sense when used on URL's or on text that is = going to be printed as part of the HTML code for a page but it doesn't seem to make se= nse for text used in a remark. - The cleanhtml function is only used on the remark text in dns.cgi and not o= n any other entries on the page. - Removing the call to the cleanhtml function results in the German umlauts b= eing printed in the remark section. - Many of the WUI pages have the cleanhtml function used on remark or comment= text. - fwhosts.cgi does not use cleanhtml anywhere. So all its remark sections wor= k with characters with diacritical marks. - If this patch is accepted, I will then submit patches for the other WUI pag= es where characters with diacritical marks are re-written in remark or comment sect= ions. Fixes: Bug#12395 Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- html/cgi-bin/dns.cgi | 2 -- 1 file changed, 2 deletions(-) diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index 0a34d3fd6..f3dd5c7a9 100644 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -141,8 +141,6 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgi= params{'SERVERS'} eq $L =20 # Go further if there was no error. if ( ! $errormessage) { - # Check if a remark has been entered. - $cgiparams{'REMARK'} =3D &Header::cleanhtml($cgiparams{'REMARK'}); =20 my %dns_servers =3D (); my $id; --=20 2.44.0 --===============0798363261053927287==--