[BUGFIX] DB: Don't check DNS on IPs

Fixes https://github.com/friendica/friendica/issues/4786
This commit is contained in:
Marcus Müller 2018-04-12 19:14:53 +02:00 committed by GitHub
parent 33d60efd8e
commit e382dfcfbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,8 @@ class dba {
}
if ($install) {
if (strlen($server) && ($server !== 'localhost') && ($server !== '127.0.0.1')) {
// server has to be a non-empty string that is not 'localhost' and not an IP
if (strlen($server) && ($server !== 'localhost') && filter_var($server, FILTER_VALIDATE_IP) === false) {
if (! dns_get_record($server, DNS_A + DNS_CNAME + DNS_PTR)) {
self::$error = L10n::t('Cannot locate DNS info for database server \'%s\'', $server);
return false;