Skip to content

Commit

Permalink
Before retrieving event by ID, check it is one of the specified other…
Browse files Browse the repository at this point in the history
… event IDs or an event from the organisation
  • Loading branch information
mark-adigital committed Sep 21, 2022
1 parent 9fe266c commit e22cccd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/services/EventbriteEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,15 @@ public function getEvent($eventId, $expansions = null, $fullDescription = true,

$event = $this->curlWrap($method);

if ($unlistedEvent === false && $event['listed'] === false)
$otherEventIds = array_column(json_decode(Eventbrite::$plugin->nonAdminSettings->get()->one()->otherEventIds), 0);
if (($unlistedEvent === false && $event['listed'] === false) || ($event['organization_id'] != Eventbrite::$plugin->getSettings()->organisationId && !array_search($eventId, $otherEventIds)))
{
$event = null;
} elseif ($fullDescription) {
$htmlDescription = $this->getEventDescription($eventId);
$event['htmlDescription'] = $htmlDescription;
}
elseif ($fullDescription)
{
$htmlDescription = $this->getEventDescription($eventId);
$event['htmlDescription'] = $htmlDescription;
}

return $event;
Expand Down

0 comments on commit e22cccd

Please sign in to comment.