forked from GithubBackups/vichan
pages.php: use DnsDriver
This commit is contained in:
parent
d210f408dc
commit
456356ad9a
@ -6,6 +6,7 @@ use Vichan\Context;
|
||||
use Vichan\Data\{IpNoteQueries, UserPostQueries, ReportQueries};
|
||||
use Vichan\Functions\{Format, Net};
|
||||
use Vichan\Data\Driver\{CacheDriver, LogDriver};
|
||||
use Vichan\Data\Driver\Dns\DnsDriver;
|
||||
|
||||
defined('TINYBOARD') or exit;
|
||||
|
||||
@ -971,7 +972,11 @@ function mod_user_posts_by_ip(Context $ctx, string $cip, ?string $encoded_cursor
|
||||
}
|
||||
|
||||
if ($config['mod']['dns_lookup'] && empty($config['ipcrypt_key'])) {
|
||||
$args['hostname'] = rDNS($ip);
|
||||
$resolver = $ctx->get(DnsDriver::class);
|
||||
$names = $resolver->IPToNames($ip);
|
||||
if (!empty($names)) {
|
||||
$args['hostname'] = $names[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (hasPermission($config['mod']['view_ban'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user