Fix use of get url

This commit is contained in:
Laurent Destailleur 2021-06-10 00:13:23 +02:00
parent 067f37e22e
commit 3cc478b133

View File

@ -71,7 +71,7 @@ class BlockedLogAuthority
$this->blockchain = ''; $this->blockchain = '';
if (is_array($bocks)) { if (is_array($blocks)) {
foreach ($blocks as &$b) { foreach ($blocks as &$b) {
$this->blockchain .= $b->signature; $this->blockchain .= $b->signature;
} }
@ -299,10 +299,11 @@ class BlockedLogAuthority
$signature = $block_static->getSignature(); $signature = $block_static->getSignature();
if (is_array($blocks)) {
foreach ($blocks as &$block) { foreach ($blocks as &$block) {
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$signature.'&b='.$block->signature; $url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$signature.'&b='.$block->signature;
$res = file_get_contents($url); $res = getURLContent($url);
echo $block->signature.' '.$url.' '.$res.'<br>'; echo $block->signature.' '.$url.' '.$res.'<br>';
if ($res === 'blockalreadyadded' || $res === 'blockadded') { if ($res === 'blockalreadyadded' || $res === 'blockadded') {
$block->setCertified(); $block->setCertified();
@ -311,6 +312,7 @@ class BlockedLogAuthority
return -1; return -1;
} }
} }
}
return 1; return 1;
} }