1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Unused variable in

Discussion in 'Resolved Bug Reports' started by ragtek, Jun 22, 2011.

  1. ragtek

    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)),
            );
        }
     
  2. Kier

    Kier XenForo Developer Staff Member

    Resolved in 1.0.3
     
    Vincent likes this.

Share This Page