Skip to content

Commit

Permalink
Provide a default for rep_interval to prevent uncaught exceptions on …
Browse files Browse the repository at this point in the history
…post requests
  • Loading branch information
campbell-m committed Aug 11, 2023
1 parent 25f9d01 commit f27b750
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web/edit_entry_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ function invalid_booking(string $message) : void
}
}

// Provide a default for $rep_interval (it could be null in an Ajax post request
// if the user has an empty string in the input).
if (!isset($rep_interval))
{
$rep_interval = 1;
}

// Sanitize the room ids
$rooms = array_map(__NAMESPACE__ . '\sanitize_room_id', $rooms);

Expand Down

0 comments on commit f27b750

Please sign in to comment.