Bug 12395 - WebIF - Domain Name System does not correctly display German Umlauts
Summary: WebIF - Domain Name System does not correctly display German Umlauts
Status: CLOSED FIXED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: all All
: Will affect an average number of users Aesthetic Issue
Assignee: Adolf Belka
QA Contact: Peter Müller
URL:
Keywords:
: 12330 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-01 15:00 UTC by Michael
Modified: 2024-04-20 08:08 UTC (History)
3 users (show)

See Also:


Attachments
Field remark in Domain Name System Webpage (11.84 KB, image/png)
2020-05-01 15:00 UTC, Michael
Details
Host definition showing the umlaut displayed in the WUI page (4.31 KB, image/png)
2024-02-27 10:01 UTC, Adolf Belka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2020-05-01 15:00:27 UTC
Created attachment 751 [details]
Field remark in Domain Name System Webpage

Currently the WebIF for the Domain Name System does not accept German Umlauts as remark, as shown in the attachment.

I've used remark: "Freifunk München e.V."

Using latest Firefox on Windows 10 Pro German x64. IPFire core 144.

Michael
Comment 1 Adolf Belka 2024-02-27 10:00:10 UTC
I have just had a quick look at this.

The problem is not limited to the DNS WUI page. You also get the same thing if you add Freifunk München e.V. as a remark into a DHCP fixed lease or an OpenVPN client connection remark.

However interestingly enough it shows up correctly in the Firewall Groups WUI page for a Host name when added as a remark.

I have had a look at the code for displaying the remark in the DNS versus that for the Host page but have not been able to identify anything that I would expect to make the difference.

I have checked out all the remark boxes for the Networks, Hosts, Network/Host Groups and the Service Groups and the Freifunk München e.V. shows up correctly in all of them, so the fwhosts.cgi fixes the problem intrinsically but I have not been able to figure out yet how it has done that.

Will continue looking.
Comment 2 Adolf Belka 2024-02-27 10:01:19 UTC
Created attachment 1483 [details]
Host definition showing the umlaut displayed in the WUI page
Comment 3 Adolf Belka 2024-02-27 15:11:31 UTC
It looks like I may have figured out what is causing the issue.

The remark text is fed through a cleanhtml function which ends up replacing all characters that are considered "unsafe" with their entity representation.

That makes sense for anything that is going to be used for html printing on the WUI page because you don't want to have "unsafe" characters in the html as it may instruct the page to do unexpected things.

However, it looks like all text, such as for comments and remarks on the cgi pages are fed through the cleanhtml function except for on the fwhosts.cgi page, which is the one that keeps the umlauts as intended and saves them correctly to the file.

The HTML::Entities::encode_entities by default encodes control chars, high-bit chars, and the <, &, >, ' and " characters. The letters with umlauts (or other diacritical accents) are covered I believe by the high-bit chars and therefore all accented characters in remarks are replaced by their html entity representation.

I will correct the dns.cgi one, as that is very simple as the cleanhtml is only used once in the code and that is only for the remark text.

I will then separately modify the other WUI pages.
Comment 5 Adolf Belka 2024-02-28 19:37:51 UTC
Patch merged into next (will be CU 185)

https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=7c6ff5ff12331a53f416080a44c8d6145e78bfac
Comment 7 Adolf Belka 2024-03-26 12:42:19 UTC
CU 185 Testing has been issued.

https://www.ipfire.org/blog/ipfire-2-29-core-update-185-is-available-for-testing
Comment 8 Adolf Belka 2024-03-26 12:49:56 UTC
The umlauts are verified to now be shown in the remark entry.
Comment 9 Michael Tremer 2024-04-08 17:16:36 UTC
*** Bug 12330 has been marked as a duplicate of this bug. ***