Fixed bug on domain block entity format check
This commit is contained in:
parent
90e2263af8
commit
f2d4119dfa
1 changed files with 2 additions and 2 deletions
|
@ -394,8 +394,8 @@ if ($idata['IsMastodon'] && $idata['Version']>='4.0.0') {
|
|||
eecho(1,'«'.$opts['hostname'].'»: got instance domain blocks from API v1 :-)'.N);
|
||||
$idata['blocks']=[];
|
||||
foreach ($buf as $key=>$block) {
|
||||
if (make(['domain', 'digest', 'severity', 'comment'],$block) && is_string($block['domain']) && !isempty($block['domain']) && is_string($block['digest']) && preg_match('/^[a-f0-9]{64}$/',$block['digest'])===1 && is_string($block['severity']) && in_array($block['severity'], ['silence','suspend']) && is_string($block['comment'])) {
|
||||
if (trim($block['comment'])=='') $block['comment']=null;
|
||||
if (make(['domain', 'digest', 'severity', 'comment'],$block) && is_string($block['domain']) && !isempty($block['domain']) && is_string($block['digest']) && preg_match('/^[a-f0-9]{64}$/',$block['digest'])===1 && is_string($block['severity']) && in_array($block['severity'], ['silence','suspend']) && (is_null($block['comment']) || is_string($block['comment']))) {
|
||||
if (!is_null($block['comment']) && trim($block['comment'])=='') $block['comment']=null;
|
||||
$idata['blocks'][]=['dom'=>$block['domain'], 'sev'=>$block['severity'], 'comm'=>$block['comment']];
|
||||
} else {
|
||||
eecho(2,'«'.$opts['hostname'].'»: domain block '.$key.' has unexpected format.'.N);
|
||||
|
|
Loading…
Reference in a new issue