-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
What?
This is on me. I coded/hardcoded the IP address validation to be done against a single valued JSON Key instead of an array of possible IPs/Ranges that allow an embargo to be bypassed.
The offending (more like single acting) code is this
if (strlen($ip_embargo_key) > 0 && !empty($jsondata[$ip_embargo_key]) && is_string($jsondata[$ip_embargo_key])) {
$current_ip = $this->requestStack->getCurrentRequest()->getClientIp();
if ($current_ip) {
$ip_embargo = IpUtils::checkIp4($current_ip, trim($jsondata[$ip_embargo_key]));
$noembargo = $noembargo && $ip_embargo;
}
}And what I need to add is a different strategy (iterating over each entry and accumulating/binary OR/AND resolved embargo bypasses if the field contains multiple single strings.
@alliomeria what I mentioned today.
alliomeria
Metadata
Metadata
Assignees
Labels
EmbargoesHeart Shaped boxesHeart Shaped boxes