From patchwork Wed Feb 28 13:35:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7564 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4TlFjN6b6Dz3wmD for ; Wed, 28 Feb 2024 13:35:36 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4TlFjM1Z4rz1kZ; Wed, 28 Feb 2024 13:35:35 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4TlFjL5rTfz30HZ; Wed, 28 Feb 2024 13:35:34 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4TlFjJ4PHkz3009 for ; Wed, 28 Feb 2024 13:35:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4TlFjH5YDqz1kZ; Wed, 28 Feb 2024 13:35:31 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1709127331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gtsCPyxPmjsNiVptIbWwciXjJBPp8oaIN+PAwYTalsY=; b=bRZ9OHbtEsGjnjRNGtTmv/q94otAjrFMsfSiuWFLufr/AUADpkU1ATujSksqHTdgEtfzCV q/H/ni/xkUiS6kDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1709127331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gtsCPyxPmjsNiVptIbWwciXjJBPp8oaIN+PAwYTalsY=; b=XMYlRpmiLOF3+Mm6EBOSQ6SLeFga6+W5z88eayYo9T/bJskbd39KwqOlrHuID9dsQTI6gh L7qK4uPzGLZdTQOSUlD2hnRwg+uwmT1w21uzOds8e+hPr1V1lESRquffi+c09ff7aUdxfv 947b6VIa421fl2edrLPelMP5nGUNy5XauuNbMJX4pQWWQTnt0ubuImmsKj8IqGxg8VU+MB rvDG8JGxHWbXjUtGqow8jl9vPD+52mN6YJd/cbSe2UUAkUaArF3lf4GPw+TVHGZ+w9XF3Y 32bf7Kkq8Dbrmb47SDMjSz6s25inyhrZFWVd/xFg5WcbR7cP++AkqX6teZchBQ== 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 Message-ID-Hash: CZRB7ORKJ3LFLJP37TTI2NN3RW55O4AX X-Message-ID-Hash: CZRB7ORKJ3LFLJP37TTI2NN3RW55O4AX X-MailFrom: adolf.belka@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: - If Freifunk München e.V. is entered as a remark it gets converted to Freifunk München e.V. - This is because cleanhtml is used on the remark text before saving it to the file and the HTML::Entities::encode_entities command that is run on that remark text encodes all higher bit characters as unsafe characters and replaces them with their HTML entity representation. - Have tested out the remark with a range of different characters with diacritical 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 sense for text used in a remark. - The cleanhtml function is only used on the remark text in dns.cgi and not on any other entries on the page. - Removing the call to the cleanhtml function results in the German umlauts being 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 work with characters with diacritical marks. - If this patch is accepted, I will then submit patches for the other WUI pages where characters with diacritical marks are re-written in remark or comment sections. 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'}) || ($cgiparams{'SERVERS'} eq $L # Go further if there was no error. if ( ! $errormessage) { - # Check if a remark has been entered. - $cgiparams{'REMARK'} = &Header::cleanhtml($cgiparams{'REMARK'}); my %dns_servers = (); my $id;