u01jmg3 / ics-parser

Parser for iCalendar Events • PHP 8+, 7 (≥ 7.4), 5 (≥ 5.6)
MIT License
448 stars 144 forks source link

Undefined offset: 2 in src/ICal/ICal.php on line 1692 #264

Closed room34 closed 4 years ago

room34 commented 4 years ago

With display_errors on, I have in a previous version run into an undefined offset error in the code that currently appears at line 1692 in src/ICal/ICal.php. Since the code has not been changed in this version, I assume the problem persists. I've previously resolved this by modifying that line with a conditional:

<?php

if (isset($valuesList[$setPosition - 1])) {
    $filteredMatches[] = $valuesList[$setPosition - 1];
}

I just updated to version 2.1.18 and verified that this issue persists in the new version. The conditional resolves it.