mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
misc: Minor improvements (#1898)
* misc: Minor improvements * Update functions.php * Update functions.php
This commit is contained in:
parent
513e3065d3
commit
2f026921ee
2 changed files with 9 additions and 2 deletions
|
@ -342,7 +342,7 @@ function _set_var(&$result, $var, $type, $multibyte = false)
|
|||
* @param $var_name
|
||||
* @param $default
|
||||
* @param bool $multibyte
|
||||
* @return array
|
||||
* @return array|string
|
||||
*/
|
||||
function get_var($var_name, $default, $multibyte = false)
|
||||
{
|
||||
|
|
|
@ -2218,9 +2218,16 @@ function infoByIP(string $ipAddress, int $port = 0): array
|
|||
'continent' => $json['continent'],
|
||||
'continentCode' => $json['continentCode']
|
||||
];
|
||||
CACHE('bb_ip2countries')->set($cacheName, $data, 1200);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data)) {
|
||||
$data = [
|
||||
'response' => false,
|
||||
'timestamp' => TIMENOW
|
||||
];
|
||||
}
|
||||
CACHE('bb_ip2countries')->set($cacheName, $data, 1200);
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue