From: Adolf Belka Date: Wed, 13 Mar 2024 22:12:12 +0000 (+0100) Subject: dns.cgi: Add use Encode + encode back to UTF-8 X-Git-Tag: v2.29-core185~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd7a901109751cfa28b7cae01e04192aa17232b4;p=ipfire-2.x.git dns.cgi: Add use Encode + encode back to UTF-8 - use Encode was missed out in the previous patch for dns.cgi This would mean that the decode from UTF-8 would fail. I had tested the previous change but forgot to copy across the use Encode line when I created the patch. - This patch adds an encode back to UTF-8 after running the cleanhtml command. This way the text is decoded from UTF-8 so that the cleanhtml command works correctly on umlauted characters and then is encoded back to UTF-8 so that all text in the cgi page is UTF-8. Tested-by: Adolf Belka Signed-off-by: Adolf Belka Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index eb6f908d50..c864c127d1 100644 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2020 IPFire Development Team # +# Copyright (C) 2005-2024 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -21,6 +21,7 @@ use strict; use IO::Socket; +use Encode; # enable only the following on debugging purpose #use warnings; @@ -151,6 +152,9 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgiparams{'SERVERS'} eq $L # 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;