mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 17:59:21 +02:00
Add check to avoid parsing user ip address history if empty
This commit is contained in:
parent
26db6b3c45
commit
13af27a43b
1 changed files with 5 additions and 2 deletions
|
@ -900,7 +900,7 @@ class User extends database_object
|
|||
$sip = $sipar[0];
|
||||
}
|
||||
|
||||
$ip = Dba::escape(inet_pton($sip));
|
||||
$ip = (!empty($sip)) ? Dba::escape(inet_pton($sip)) : '';
|
||||
$date = time();
|
||||
$user = $this->id;
|
||||
$agent = Dba::escape($_SERVER['HTTP_USER_AGENT']);
|
||||
|
@ -1033,7 +1033,10 @@ class User extends database_object
|
|||
|
||||
/* Get Users Last ip */
|
||||
if (count($data = $this->get_ip_history(1))) {
|
||||
$this->ip_history = inet_ntop($data['0']['ip']);
|
||||
$ip = $data['0']['ip'];
|
||||
if (!empty($ip)) {
|
||||
$this->ip_history = inet_ntop($ip);
|
||||
}
|
||||
} else {
|
||||
$this->ip_history = T_('Not Enough Data');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue