Fixed  Unused variable in

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
In Method getContentIpInfo and getOnlineUserIp you set a variable contentHost, but you don't use it.

Instead of using it, you run _getHost a second time.

PHP:
    public function getContentIpInfo(array $content)
    {
        if ($content['ip_id'])
        {
            $ip = $this->getIpById($content['ip_id']);
            $contentIp = $ip['ip_address'];
            $contentHost = $this->_getHost($contentIp);
        }

        return $this->getRegistrationIps($content['user_id']) + array(
            'contentIp'    => (empty($contentIp) ? false : $contentIp),
            'contentHost'  => (empty($contentIp) ? false : $this->_getHost($contentIp)),
        );
    }

    /**
     * Gets IP info for an online user
     *
     * @param array $onlineUser
     *
     * @return array (contentIp, contentHost, registrationIp, registrationHost, confirmationIp, confirmationHost)
     */
    public function getOnlineUserIp($onlineUser)
    {
        if ($onlineUser['ip'])
        {
            $contentIp = long2ip($onlineUser['ip']);
            $contentHost = $this->_getHost($contentIp);
        }

        return $this->getRegistrationIps($onlineUser['user_id']) + array(
            'contentIp'   => (empty($contentIp) ? false : $contentIp),
            'contentHost' => (empty($contentIp) ? false : $this->_getHost($contentIp)),
        );
    }
 
Top Bottom