Skip to content

Commit cb3020d

Browse files
committed
gpld-last-day-of-the-month-only.php: Fixed potential PHP error.
1 parent f88674b commit cb3020d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gp-limit-dates/gpld-last-day-of-the-month-only.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
$range_end = $cloned_date_range->add( new DateInterval( 'P1Y' ) );
1616

1717
$period = new DatePeriod( $range_start, new DateInterval( 'P1M' ), $range_end );
18+
19+
if ( empty( $options['exceptions'] ) || ! is_array( $options['exceptions'] ) ) {
20+
$options['exceptions'] = array();
21+
}
22+
1823
foreach ( $period as $date ) {
1924
$options['exceptions'][] = gmdate( 'm/d/Y', strtotime( 'last day ' . $date->format( 'm/01/Y' ) ) );
2025
}

0 commit comments

Comments
 (0)