File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -123,11 +123,23 @@ public function embargoInfo(string $uuid, array $jsondata) {
123123 }
124124 }
125125 $ ip_embargo_key = $ this ->embargoConfig ->get ('ip_json_key ' );
126- if (strlen ($ ip_embargo_key ) > 0 && !empty ($ jsondata [$ ip_embargo_key ]) && is_string ( $ jsondata [ $ ip_embargo_key ]) ) {
126+ if (strlen ($ ip_embargo_key ) > 0 && !empty ($ jsondata [$ ip_embargo_key ])) {
127127 $ current_ip = $ this ->requestStack ->getCurrentRequest ()->getClientIp ();
128128 if ($ current_ip ) {
129- $ ip_embargo = IpUtils::checkIp4 ($ current_ip , trim ($ jsondata [$ ip_embargo_key ]));
130- $ noembargo = $ noembargo && $ ip_embargo ;
129+ if (is_array ($ jsondata [$ ip_embargo_key ])) {
130+ foreach ($ jsondata [$ ip_embargo_key ] as $ ip_embargo_value ) {
131+ if (is_string ($ ip_embargo_value )) {
132+ $ ip_embargo = IpUtils::checkIp4 ($ current_ip , trim ($ ip_embargo_value )) || $ ip_embargo ;
133+ // Here we need to do it differently. We will || all the $ip_embargo
134+ // and then check the $noembargo variable outside of this loop
135+ }
136+ }
137+ $ noembargo = $ noembargo && $ ip_embargo ;
138+ }
139+ elseif (is_string ($ jsondata [$ ip_embargo_key ])) {
140+ $ ip_embargo = IpUtils::checkIp4 ($ current_ip , trim ($ jsondata [$ ip_embargo_key ]));
141+ $ noembargo = $ noembargo && $ ip_embargo ;
142+ }
131143 }
132144 }
133145 $ embargo_info = [!$ noembargo , $ date_embargo ? $ date : FALSE , $ ip_embargo ];
You can’t perform that action at this time.
0 commit comments