pi-hole / web

Pi-hole Dashboard for stats and more
https://pi-hole.net
Other
2.02k stars 560 forks source link

Editing a comment within Blacklist/Whitelist that contains apostrophe symbol (') gets changed to ' after confirming #2279

Open DinoBrdar92 opened 2 years ago

DinoBrdar92 commented 2 years ago

Versions

Platform

Expected behavior

Writing a comment within Blacklist/Whitelist with an apostrophe (') should have an apostrophe after confirming my comment

Actual behavior / bug

Writing a comment within Blacklist/Whitelist that contains apostrophe (') gets changed to ' after confirming

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to 'Blacklist or Whitelist'
  2. Edit comment of any of the entries (add an entry first if there's none) and write ' in it
  3. Click anywhere to confirm editing
  4. See error: ' should change to '

Debug Token

Screenshots

Screenshot from Reddit post here

andrewmccarthy commented 11 months ago

Comparing groups-adlists.php and groups-domains.php they both seem to work the same. Also, in both cases they store an apostrophe in the database as '. The difference is at lines 520-522 at script/.../groups.php, where for get_domains the comment and domain fields are passed through htmlentities() (thus turning ' into '), but for get_adlists they aren't.

yubiuser commented 10 months ago

Will be fixed by https://github.com/pi-hole/web/pull/2851 in v6