Closed room34 closed 1 year ago
Thanks for logging this issue. A PR is welcome.
I have a workaround for now, but I don't know the code base well enough to offer a proper fix. My workaround (PHP >= 7) is to just append ?? ''
to these lines.
??
can be rewritten as just a standard ternary (is_null($var) ? $var : ''
)
I see that the change committed is only accounting for non-breaking spaces but not other HTML ampersand entities. Did you confirm that it was only nbsp’s that were causing the problem?
I've focussed on the non-breaking space for now as it affects the unfolding mechanism that's permitted in the iCal spec.
8.1.2
America/Chicago
3.2.1
Description of the Issue:
If the .ics file contains an ampersand entity in the DESCRIPTION (though I suspect the issue may just be the semicolon), I get the following PHP warnings:
Warning: Undefined array key 4 in /var/www/.../ics-parser/src/ICal/ICal.php on line 1033
Warning: Undefined array key 4 in /var/www/.../ics-parser/src/ICal/ICal.php on line 1042
(The attached file has a
.txt
extension appended so GitHub will accept the upload.) AmpersandEntityExample.ics.txtSteps to Reproduce:
Use attached example which contains an HTML ampersand entity in the DESCRIPTION. This is an actual example from one of my users, with all events other than the one containing the ampersand entity removed.