X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdba.php;h=b24d9b409d00125ad7349848d822089a5e908aff;hb=e7680a40d4ae5cf7529eb36d90c63d14e4531faf;hp=586fc092fb764c51b9c54587f167b30570b51c20;hpb=5e5fde0a63c57d2873bfa29404110269ca9abeee;p=friendica.git diff --git a/include/dba.php b/include/dba.php index 586fc092fb..b24d9b409d 100644 --- a/include/dba.php +++ b/include/dba.php @@ -52,8 +52,9 @@ class dba { } if ($install) { - if (strlen($server) && ($server !== 'localhost') && ($server !== '127.0.0.1')) { - if (! dns_get_record($server, DNS_A + DNS_CNAME + DNS_PTR)) { + // 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)) { self::$error = L10n::t('Cannot locate DNS info for database server \'%s\'', $server); return false; }