From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4gQYXr2VLbz30Sf for ; Wed, 27 May 2026 15:33:00 +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) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4gQYXr25rRz2xPV for ; Wed, 27 May 2026 15:33:00 +0000 (UTC) Received: from people01.haj.ipfire.org (people01.haj.ipfire.org [172.28.1.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bit raw public key) server-digest SHA256 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "people01.haj.ipfire.org", Issuer "E8" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4gQYXq3B81z23K for ; Wed, 27 May 2026 15:32:59 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1779895979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=D6qxtKwVAEotW97mGn0axF+6KBr38dCGKPvNBAlElt8=; b=iTl05rd/cu+/cMKgQKxlPPN0C2m9nwX+FGFfyZ1NZuzP0atvdP5GIO+16MAqfyPK4yNlOy MwYvy00hi75MRqAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1779895979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=D6qxtKwVAEotW97mGn0axF+6KBr38dCGKPvNBAlElt8=; b=n2g3NV/gAUSc8kg/eIoWETPo9H9RIgOagtCLqzeNCBW3+PD87V7zdPt+SRlaIkB/pDLiAq Mr222YPkh82bBYp27HG9WBKrZAbke4/BhmBUWZglnTwQKGdwdUDWpE6apHeOwpYzPPZxsa 4OVLgWB93JpQPa2T6MaP7Ndh6e53SXVZ1jWJlqATgYJqpEP8DdAqc0pQ8ej7RIUj9UlbPn cKNe1T4TITe0TDtPboJR4ML1ukPBES03ZZBZBhNRo21iIyhY/aIeOQBSps1B+JeAFgJbI4 EZ154J4WYFeHm2TqTU5my0E8opkexzsnsUdCXD4HW2haktyuEMKZhJ4wedOV8w== Received: by people01.haj.ipfire.org (Postfix, from userid 1000) id 4gQYXq0dY8z2xKs; Wed, 27 May 2026 15:32:59 +0000 (UTC) To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. eebf365a5145e16a85b5a49337ab496fed3fbe78 X-Git-Refname: refs/heads/next X-Git-Reftype: branch X-Git-Oldrev: e5a6fe6a944fdc68999a978ce983bee942722730 X-Git-Newrev: eebf365a5145e16a85b5a49337ab496fed3fbe78 Message-Id: <4gQYXq0dY8z2xKs@people01.haj.ipfire.org> Date: Wed, 27 May 2026 15:32:58 +0000 (UTC) From: Michael Tremer Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, next has been updated via eebf365a5145e16a85b5a49337ab496fed3fbe78 (commit) via 5cc28b941e85637adba68bea9bc2caa866678241 (commit) via a6c585b677e3c4b5bdcf0ea8c3886c9cb20ae623 (commit) from e5a6fe6a944fdc68999a978ce983bee942722730 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit eebf365a5145e16a85b5a49337ab496fed3fbe78 Author: Michael Tremer Date: Wed May 27 16:32:25 2026 +0100 core203: Ship the entire web UI again Since we have now been adding so many files, it is easier to ship the whole thing again. Signed-off-by: Michael Tremer commit 5cc28b941e85637adba68bea9bc2caa866678241 Author: Michael Tremer Date: Wed May 27 16:30:44 2026 +0100 header.pl: Drop cleanhtml() This function was pretty much doing what escape() is doing, but had some weird functions that were unclear and not used anyways. Using escape() only makes the code slightly shorter and cleaner. Suggested-by: Adolf Belka Signed-off-by: Michael Tremer commit a6c585b677e3c4b5bdcf0ea8c3886c9cb20ae623 Author: Michael Tremer Date: Wed May 27 16:17:33 2026 +0100 header.pl: Decode/encode UTF-8 strings before escaping HTML::Entities::encode_entities() does not seem to be able to work with UTF-8 which therefore needs to be decoded before and encoded back afterwards. Signed-off-by: Michael Tremer ----------------------------------------------------------------------- Summary of changes: config/cfgroot/header.pl | 27 +++++++++++----------- config/rootfiles/core/203/filelists/files | 7 ------ .../112 => core/203}/filelists/web-user-interface | 0 html/cgi-bin/aliases.cgi | 2 +- html/cgi-bin/connscheduler.cgi | 2 +- html/cgi-bin/dhcp.cgi | 8 +++---- html/cgi-bin/dns.cgi | 2 +- html/cgi-bin/dnsforward.cgi | 2 +- html/cgi-bin/ipinfo.cgi | 2 +- html/cgi-bin/logs.cgi/ids.dat | 4 ++-- html/cgi-bin/logs.cgi/log.dat | 2 +- html/cgi-bin/logs.cgi/proxylog.dat | 4 ++-- html/cgi-bin/logs.cgi/summary.dat | 2 +- html/cgi-bin/media.cgi | 2 +- html/cgi-bin/netother.cgi | 6 ++--- html/cgi-bin/ovpnmain.cgi | 14 +++++------ html/cgi-bin/qos.cgi | 2 +- html/cgi-bin/remote.cgi | 4 ++-- html/cgi-bin/routing.cgi | 2 +- html/cgi-bin/samba.cgi | 4 ++-- html/cgi-bin/time.cgi | 2 +- html/cgi-bin/vpnmain.cgi | 18 +++++++-------- html/cgi-bin/wakeonlan.cgi | 2 +- html/cgi-bin/wio.cgi | 2 +- html/cgi-bin/wireless.cgi | 4 ++-- 25 files changed, 59 insertions(+), 67 deletions(-) copy config/rootfiles/{oldcore/112 => core/203}/filelists/web-user-interface (100%) Difference in files: diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index a1a39bb4e..05f67fc0d 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -627,7 +627,18 @@ sub getcgihash { sub escape($) { my $s = shift; - return HTML::Entities::encode_entities($s); + + # Decode from UTF-8 as HTML::Entitites::encode_entities + # does not support it. + $s = &Encode::decode("UTF-8", $s); + + # Escape any HTML entities + $s = &HTML::Entities::encode_entities($s); + + # Encode back to UTF-8 + $s = &Encode::encode("UTF-8", $s); + + return $s; } sub normalize($) { @@ -642,18 +653,6 @@ sub normalize($) { return $s; } -sub cleanhtml { - my $outstring =$_[0]; - $outstring =~ tr/,/ / if not defined $_[1] or $_[1] ne 'y'; - # decode the UTF-8 text so that characters with diacritical marks such as - # umlauts are treated correctly by the escape command - $outstring = &Encode::decode("UTF-8",$outstring); - $outstring = escape($outstring); - # encode the text back to UTF-8 after running the escape command - $outstring = &Encode::encode("UTF-8",$outstring); - return $outstring; -} - sub connectionstatus { my $iface=''; @@ -766,7 +765,7 @@ END my $col = ""; my $divider_printed = 0; foreach my $key (sort leasesort keys %entries) { - my $hostname = &cleanhtml($entries{$key}->{HOSTNAME},"y"); + my $hostname = &escape($entries{$key}->{HOSTNAME}); my $hostname_print = $hostname; if($hostname_print eq "") { #print blank space if no hostname is found $hostname_print = "   "; diff --git a/config/rootfiles/core/203/filelists/files b/config/rootfiles/core/203/filelists/files index 87d9e6533..ac40b5083 100644 --- a/config/rootfiles/core/203/filelists/files +++ b/config/rootfiles/core/203/filelists/files @@ -13,13 +13,6 @@ etc/rc.d/rc0.d/K86knot-resolver etc/rc.d/rc3.d/S11knot-resolver etc/rc.d/rc3.d/S17waitfordns etc/rc.d/rc6.d/K86knot-resolver -srv/web/ipfire/cgi-bin/dhcp.cgi -srv/web/ipfire/cgi-bin/dns.cgi -srv/web/ipfire/cgi-bin/dnsbl.cgi -srv/web/ipfire/cgi-bin/dnsforward.cgi -srv/web/ipfire/cgi-bin/hosts.cgi -srv/web/ipfire/cgi-bin/services.cgi -srv/web/ipfire/cgi-bin/time.cgi usr/local/bin/settime usr/local/bin/update-rpzs var/ipfire/backup/bin/backup.pl diff --git a/config/rootfiles/core/203/filelists/web-user-interface b/config/rootfiles/core/203/filelists/web-user-interface new file mode 120000 index 000000000..70c74b438 --- /dev/null +++ b/config/rootfiles/core/203/filelists/web-user-interface @@ -0,0 +1 @@ +../../../common/web-user-interface \ No newline at end of file diff --git a/html/cgi-bin/aliases.cgi b/html/cgi-bin/aliases.cgi index aa1ea4cb6..80faea0ae 100644 --- a/html/cgi-bin/aliases.cgi +++ b/html/cgi-bin/aliases.cgi @@ -158,7 +158,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) { if ($settings{'ACTION'} eq $Lang::tr{'add'}) { # Validate inputs if (! &General::validip($settings{'IP'})) {$errormessage = "invalid ip"}; - $settings{'NAME'} = &Header::cleanhtml($settings{'NAME'}); + $settings{'NAME'} = &Header::escape($settings{'NAME'}); # Make sure we haven't duplicated an alias or RED my $spacer=''; diff --git a/html/cgi-bin/connscheduler.cgi b/html/cgi-bin/connscheduler.cgi index cc78cbc1b..2f4332691 100644 --- a/html/cgi-bin/connscheduler.cgi +++ b/html/cgi-bin/connscheduler.cgi @@ -186,7 +186,7 @@ if ( ($cgiparams{'ACTION'} eq 'add') || ($cgiparams{'ACTION'} eq 'update') ) $CONNSCHED::config[$i]{'DAYSTYPE'} = lc($cgiparams{'ACTION_DAYSTYPE'}); $CONNSCHED::config[$i]{'DAYS'} = $l_days; $CONNSCHED::config[$i]{'WEEKDAYS'} = $l_weekdays; - $CONNSCHED::config[$i]{'COMMENT'} = &Header::cleanhtml($cgiparams{'ACTION_COMMENT'}); + $CONNSCHED::config[$i]{'COMMENT'} = &Header::escape($cgiparams{'ACTION_COMMENT'}); &CONNSCHED::WriteConfig; } diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi index 37c1bf715..4b84ada42 100644 --- a/html/cgi-bin/dhcp.cgi +++ b/html/cgi-bin/dhcp.cgi @@ -455,10 +455,10 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { } unless ($errormessage) { - $dhcpsettings{'FIX_REMARK'} = &Header::cleanhtml($dhcpsettings{'FIX_REMARK'}); - $dhcpsettings{'FIX_NEXTADDR'} = &Header::cleanhtml($dhcpsettings{'FIX_NEXTADDR'}); - $dhcpsettings{'FIX_FILENAME'} = &Header::cleanhtml($dhcpsettings{'FIX_FILENAME'}); - $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); + $dhcpsettings{'FIX_REMARK'} = &Header::escape($dhcpsettings{'FIX_REMARK'}); + $dhcpsettings{'FIX_NEXTADDR'} = &Header::escape($dhcpsettings{'FIX_NEXTADDR'}); + $dhcpsettings{'FIX_FILENAME'} = &Header::escape($dhcpsettings{'FIX_FILENAME'}); + $dhcpsettings{'FIX_ROOTPATH'} = &Header::escape($dhcpsettings{'FIX_ROOTPATH'}); if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index ca47e89cc..c02f0a4b7 100644 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -147,7 +147,7 @@ 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'}); + $cgiparams{'REMARK'} = &Header::escape($cgiparams{'REMARK'}); my %dns_servers = (); my $id; diff --git a/html/cgi-bin/dnsforward.cgi b/html/cgi-bin/dnsforward.cgi index 91acb1c0b..3b066902b 100644 --- a/html/cgi-bin/dnsforward.cgi +++ b/html/cgi-bin/dnsforward.cgi @@ -88,7 +88,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'add'}) $cgiparams{'FORWARD_SERVERS'} = join("|", @forward_servers); # Check if a remark has been entered. - $cgiparams{'REMARK'} = &Header::cleanhtml($cgiparams{'REMARK'}); + $cgiparams{'REMARK'} = &Header::escape($cgiparams{'REMARK'}); # Set to off if not enabled if (!$cgiparams{'DISABLE_DNSSEC'}) { diff --git a/html/cgi-bin/ipinfo.cgi b/html/cgi-bin/ipinfo.cgi index fd490b08e..3e0be4f46 100644 --- a/html/cgi-bin/ipinfo.cgi +++ b/html/cgi-bin/ipinfo.cgi @@ -191,7 +191,7 @@ END print "
\n";
 	foreach my $line (@lines) {
-		print &Header::cleanhtml($line,"y");
+		print &Header::escape($line);
 	}
 	print "
\n"; &Header::closebox(); diff --git a/html/cgi-bin/logs.cgi/ids.dat b/html/cgi-bin/logs.cgi/ids.dat index ef224e3e6..3d5f93fa1 100644 --- a/html/cgi-bin/logs.cgi/ids.dat +++ b/html/cgi-bin/logs.cgi/ids.dat @@ -467,10 +467,10 @@ sub processevent ($title,$classification,$priority,$date,$time,$srcip,$srcport,$destip,$destport,$sid) = ("n/a","n/a","n/a","n/a","n/a","n/a","n/a","n/a","n/a", "n/a"); @refs = (); $_ =~ m/:([0-9]{1,10})\] (.*) \[\*\*\]/; - $title = &Header::cleanhtml($2,"y"); + $title = &Header:escape($2); } if ($_ =~ m/Classification: (.*)\] \[Priority: (\d)\]/) { - $classification = &Header::cleanhtml($1,"y"); + $classification = &Header:escape($1); $priority = $2; } if ($_ =~ m/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3}) \-\> ([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/) { diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat index 90f675008..aa28ebca3 100644 --- a/html/cgi-bin/logs.cgi/log.dat +++ b/html/cgi-bin/logs.cgi/log.dat @@ -404,7 +404,7 @@ foreach $_ (@log) $day =~ tr / /0/; my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ; my $sec = $3; - my $data = &Header::cleanhtml($4, 'y'); + my $data = &Header:escape($4); print < diff --git a/html/cgi-bin/logs.cgi/proxylog.dat b/html/cgi-bin/logs.cgi/proxylog.dat index 5109ca4cf..07fc03d92 100644 --- a/html/cgi-bin/logs.cgi/proxylog.dat +++ b/html/cgi-bin/logs.cgi/proxylog.dat @@ -465,8 +465,8 @@ foreach $_ (@log) $url =~ /(^.{0,60})/; my $part = $1; unless (length($part) < 60) { $part = "${part}..."; } - $url = &Header::cleanhtml($url,"y"); - $part = &Header::cleanhtml($part,"y"); + $url = &Header:escape($url); + $part = &Header:escape($part); if ($cgiparams{'DAY'}==0) { # full month $DAYdt = sprintf ("%.02d/",$DAYdt); } else { diff --git a/html/cgi-bin/logs.cgi/summary.dat b/html/cgi-bin/logs.cgi/summary.dat index cbca48c49..cceb35228 100644 --- a/html/cgi-bin/logs.cgi/summary.dat +++ b/html/cgi-bin/logs.cgi/summary.dat @@ -190,7 +190,7 @@ if(!$skip) # box while ( $content[0] =~ /^\s*$/ ) { shift @content; } while ( $content[$#content] =~ /^\s*$/ ) { pop @content; } - foreach $_ (@content) { $_ =~ s/\s*$//; print &Header::cleanhtml($_,"y")."\n"; } + foreach $_ (@content) { $_ =~ s/\s*$//; print &Header:escape($_)."\n"; } print "\n"; &Header::closebox(); } elsif (/^\s*#+ LogWatch [^#]+[)] #+\s*$/) { diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi index c1914f469..b2eb36118 100644 --- a/html/cgi-bin/media.cgi +++ b/html/cgi-bin/media.cgi @@ -202,7 +202,7 @@ sub diskbox { } my $smart = `/usr/local/bin/smartctrl $disk`; - $smart = &Header::cleanhtml($smart); + $smart = &Header:escape($smart); print <