// Search for hostname in cache
$result = sqlQueryEscaped("SELECT `ip` FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE `hostname`='%s' LIMIT 1",
- array($hostname), __METHOD__, __LINE__);
+ array(
+ $hostname
+ ), __METHOD__, __LINE__
+ );
// Does an entry exist?
if (sqlNumRows($result) == 1) {
if (($matches[0] == $ip) && ($matches[1] >= 0) && ($matches[1] <= 255) && ($matches[2] >= 0) && ($matches[2] <= 255) && ($matches[3] >= 0) && ($matches[3] <= 255) && ($matches[4] > 0) && ($matches[4] < 255)) {
// We also cache IP addresses
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_dns_cache` (`ip`, `hostname`, `added`) VALUES ('%s', '%s', NOW())",
- array($ip, $hostname), __METHOD__, __LINE__);
+ array(
+ $ip,
+ $hostname
+ ), __METHOD__, __LINE__
+ );
// Set return value to $ip
//* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, sprintf("IP detected, cache entry written: %s->%s", $hostname, $ip));
} else {
// Put entry in DB
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_dns_cache` (`ip`, `hostname`, `added`) VALUES ('%s', '%s', NOW())",
- array($ip, $hostname), __METHOD__, __LINE__);
+ array(
+ $ip,
+ $hostname
+ ), __METHOD__, __LINE__
+ );
// Set return value to $ip
$ret = $ip;