By m4t on Sunday, 06 December 2020
Replies 3
Likes 0
Views 845
Votes 0
I would like to report a JEvents behavior which looks like a bug to me.

After exporting an ics file from a JEvents calendar and importing it in another calender application, an entry with location "a, b" showed as "a" in the other calender application.

When inspecting the ics file, i noticed that the comma is not escaped by JEvents:


...
LOCATION:a, b
...


See https://www.ietf.org/rfc/rfc2445.txt:

A COMMA character in a
"TEXT" property value MUST be escaped with a BACKSLASH character
(US-ASCII decimal 92).


There are other characters that need escaping, and probably other fields (e.g. SUMMARY) are affected too.

Could you look into this?
Thanks for highlighting this - strange that it hasn't been raised as an issue before now

The fix is to change line 148-162 of components/com_jevents/views/icals/tmpl/export.php to read

if ($a->location() != "")
{
if (!is_numeric($a->location()))
{
$html .= "LOCATION:" . $this->wraplines(str_replace(array(","), array("\,"), $this->replacetags($a->location()))) . "\r\n";
}
else if (isset($a->_loc_title))
{
$html .= "LOCATION:" . $this->wraplines(str_replace(array(","), array("\,"), $this->replacetags($a->_loc_title))) . "\r\n";
}
else
{
$html .= "LOCATION:" . $this->wraplines(str_replace(array(","), array("\,"), $this->replacetags($a->location()))) . "\r\n";
}
}

·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for your reply. I don't need a quick fix now, I just wanted to suggest you can check this calmly and then include in the next appropriate release.

Note that there are other characters which need escaping.

Have a good time.
m4t
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
This is coded in to the next release of JEvents - next week I hope.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post