Closed (fixed)
Project:
Views vCards
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Oct 2016 at 01:43 UTC
Updated:
1 May 2017 at 03:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ratatine commentedThe encoding issue is due to function template_preprocess_views_vcards_view_row_vcard is views/theme/theme.inc. It's calling check_plain() on all the variables being passed.
Still not sure about the special characters.
Comment #3
neograph734Strange, I thought this had been fixed with #2720353: Umlauts are not displayed correctly in vcard. If you have time, feel free to look around. I'll have a look at it when I can as well but that would be somewhere next week.
Comment #4
neograph734The issue appears to be coming from the
utf8_decode's and thecheck_plain's intemplate_preprocess_views_vcards_view_row_vcard()in views_vcards/views/theme/theme.inc.Once I remove those, the examples given above work as expected...
But that is not a solution, as every user can alter the values of the fields as he desires leading to potentially dangerous situations, so the text needs to be sanitized before output.
I'll try to find another way to make sure the text is save.
Comment #5
neograph734Please try attached patch, which uses
filter_xssrather thanutf8_decodeandcheck_plain.Comment #6
neograph734Comment #7
neograph734@ratatine can you confirm the attached patch works for you?
Comment #9
neograph734Committed.
Comment #11
khalimero commentedHi all,
I am facing with the same kind of problem on the last 8.x-2.0 version of the module.
The accented and apostrophe characters are not ouput correctly (the first ones seems to be encoded with the wrong charset, the second ones are raw html
'), neither in the preview nor in the vcf/zip export.I have very basic knowledge in programming, so I took a look into the views_vcards.module file, and tried to remove the utf8_decode from the few last lines.
It solved the accented characters problems, but not the apostrophe, still displayed as raw html.
Do you have any advice to solve the problem. If it helps, I precise the server is a Linux Debian server, and I am working from a Windows 10 laptop client, French version...
Regards,
Remi.
Comment #12
neograph734Hi Remi,
That is unfortunate. I did run some tests so I am not really sure why this is still occuring. To be sure, the letters you mention are just regular accented letters like
é,à,ó, etc and an apostrophe'right? So I can validate and test the problem.'is a different case, that is encoded twice;&writes as an ampersand character (&), so it should be', which in turn is HTML encoded apostrophe character ('). Perhaps the text is encoded twice, rather than encoded and decoded.I am a bit busy at the moment, so I hope I'll a moment to look into this in the short term. Thanks for making me aware of the issue!
Comment #14
neograph734Remi, could you please try the development version of the module and see if the problem is solved for you?
There still appears to be an issue with Windows and Outlook not properly displaying accented characters (
ýdisplays asý), but that appears an issue of Windows being incapable of handling UTF-8 vcards (theýis correct in the vcard file). I hope to be able to find a workaround for this as well.Comment #15
neograph734Comment #16
neograph734I believe this has been fixed and the output is correct now. There is a known issue for Windows Contacts for which I have no solution at the moment: #2866862: Windows contacts incorrectly displays special characters.
Comment #17
ratatine commentedJust a quick reply in apologies for not responding 5 months ago. Drupal.org must not be setup to notify me when new replies come in as I'm only logging in and seeing this now. Thanks for commiting the fix!