[2/2] dns.cgi: Remove the decode and encode lines as now integrated in header.pl

Message ID 20240617111236.2926-2-adolf.belka@ipfire.org
State Staged
Commit 43fea080ebb6e701c9e9171f6775c195e5964dd3
Headers
Series [1/2] header.pl: Add utf-8 handling into cleanhtml command |

Commit Message

Adolf Belka June 17, 2024, 11:12 a.m. UTC
  - decode and encode lines have now been integrated into the cleanhtml subroutine in
   header.pl so that all uses of cleanhtml will be able to handle diacritical characters

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 html/cgi-bin/dns.cgi | 11 -----------
 1 file changed, 11 deletions(-)
  

Patch

diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi
index 1181523d4..0d3b14797 100644
--- a/html/cgi-bin/dns.cgi
+++ b/html/cgi-bin/dns.cgi
@@ -21,7 +21,6 @@ 
 
 use strict;
 use IO::Socket;
-use Encode;
 
 # enable only the following on debugging purpose
 #use warnings;
@@ -143,18 +142,8 @@  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.
-
-		# decode the UTF-8 text so that characters with diacritical marks such as
-		# umlauts are treated correctly by the following cleanhtml command
-		$cgiparams{'REMARK'} = decode("UTF-8", $cgiparams{'REMARK'});
-
-		# run the REMARK text through cleanhtml to ensure all unsafe html characters
-		# are correctly encoded to their html entities
 		$cgiparams{'REMARK'} = &Header::cleanhtml($cgiparams{'REMARK'});
 
-		# encode the text back to UTF-8 after running the cleanhtml command
-		$cgiparams{'REMARK'} = encode("UTF-8", $cgiparams{'REMARK'});
-
 		my %dns_servers = ();
 		my $id;
 		my $status;