diff --git a/htdocs/blockedlog/ajax/check_signature.php b/htdocs/blockedlog/ajax/check_signature.php index cc91182293e..ba164e3e715 100644 --- a/htdocs/blockedlog/ajax/check_signature.php +++ b/htdocs/blockedlog/ajax/check_signature.php @@ -55,8 +55,10 @@ $blocks = $block_static->getLog('just_certified', 0, 0, 'rowid', 'ASC'); $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 2071eb03c47..4ec3fc6d07e 100644 --- a/htdocs/blockedlog/class/authority.class.php +++ b/htdocs/blockedlog/class/authority.class.php @@ -71,8 +71,10 @@ class BlockedLogAuthority $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;