diff --git a/htdocs/blockedlog/ajax/check_signature.php b/htdocs/blockedlog/ajax/check_signature.php index cc91182293eb3..ba164e3e715b4 100644 --- a/htdocs/blockedlog/ajax/check_signature.php +++ b/htdocs/blockedlog/ajax/check_signature.php @@ -55,8 +55,10 @@ $auth->signature = $block_static->getSignature(); -foreach ($blocks as &$b) { - $auth->blockchain .= $b->signature; +if (is_array($bocks)) { + foreach ($blocks as &$b) { + $auth->blockchain .= $b->signature; + } } $hash = $auth->getBlockchainHash(); diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php index 2071eb03c47ae..4ec3fc6d07ef6 100644 --- a/htdocs/blockedlog/class/authority.class.php +++ b/htdocs/blockedlog/class/authority.class.php @@ -71,8 +71,10 @@ public function getLocalBlockChain() $this->blockchain = ''; - foreach ($blocks as &$b) { - $this->blockchain .= $b->signature; + if (is_array($bocks)) { + foreach ($blocks as &$b) { + $this->blockchain .= $b->signature; + } } return $this->blockchain;