]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/dns.cgi
dns.cgi: Add use Encode + encode back to UTF-8
[ipfire-2.x.git] / html / cgi-bin / dns.cgi
index eb6f908d50140ecde03c54594023dcce1912ef0d..c864c127d13b4dedb63b96b5eb77efd768e83ea9 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2020  IPFire Development Team                                 #
+# Copyright (C) 2005-2024  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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;