Addpixel / KirbyComments

[Kirby 2] File-based comments stored as subpages for the Kirby CMS.
MIT License
68 stars 5 forks source link

Decode special characters when echoing names #32

Closed sylvainjule closed 7 years ago

sylvainjule commented 7 years ago

Encoding the name's html entities leads to issues with some names.

Jörn is echoed as : Jörn

Julé is echoed as : Julé

This PR decodes those characters.

(unless there was a reason not to decode them ?)

florianpircher commented 7 years ago

Why exactly is encoding Jörn as Jörn and Julé as Jul&eacute an issue? The names will still be rendered correctly on the screen.

sylvainjule commented 7 years ago

The encoding is not, but when I say they are echoed like this, I mean they aren't rendered correctly without forcing them to be decoded :

capture d ecran 2017-09-01 a 18 06 05
florianpircher commented 7 years ago

Have you taken a screenshot of your own website or of the demo page? I’ve tested both Jörn and Julé on the demo page at https://kirby-comments.addpixel.net/demos/comments and they render correctly.

sylvainjule commented 7 years ago

I was trying to reproduce this issue.

Happens with a fresh starterkit, I cloned it and put the plugin folder in, nothing more.

florianpircher commented 7 years ago

Are you using the latest version of both Kirby and Kirby Comments? I don’t seem to be able to reproduce this behaviour …

sylvainjule commented 7 years ago

That's odd. Yes, I run the 2.5.5 version and the last Kirby Comments.

florianpircher commented 7 years ago

I’ve downloaded the latest version of Kirby, installed the latest release on Kirby Comments, included the standard snippet in the article.php and it works just fine …

bildschirmfoto 2017-09-01 um 18 23 01

Have you edited the site/config.php and maybe changed something there?

florianpircher commented 7 years ago

Tested on

sylvainjule commented 7 years ago

I have not edited anything, aside from adding the comments snippet.

I just added the snippet before the closing </article> so that we have the same comparison scenario. I can add the name and preview the comment with the correct characters. So when I submit the comment the name is still fine. But if I refresh my browser, the character isn't rendered.

sylvainjule commented 7 years ago

Tested on macOS 10.12.4 with PHP 5.6.25 and PHP 7.0.10 (using MAMP) on Apache.

florianpircher commented 7 years ago

OK, thank you! I tested the preview and the submission, but have never reloaded the page after submitting it. I can reproduce this behaviour and will look into it!

florianpircher commented 7 years ago

I’ve located the bug and will submit a bugfix shortly.

florianpircher commented 7 years ago

The fix now is on master. You can clone the latest version or download the latest release. Thank you again for your help!