Contao3-Ninja / dlstats

Contao Module dlstats - Counts the number of file downloads
http://contao.ninja/download-statistik-dlstats.html
GNU Lesser General Public License v3.0
4 stars 0 forks source link

[Insight] Boolean should be compared strictly - in classes/DlstatsHelper.php, line 581 #64

Closed BugBuster1701 closed 9 years ago

BugBuster1701 commented 9 years ago

in classes/DlstatsHelper.php, line 581

With booleans, only strict comparison (with === operator) should be used to lower bug risks and to improve performances.

        if ($this->IP_Version === false || $this->IP === '0.0.0.0')
        {
            return '';
        }
        if (isset($GLOBALS['TL_CONFIG']['privacyAnonymizeIp']) && 
                  $GLOBALS['TL_CONFIG']['privacyAnonymizeIp'] == false)
        {
            // Anonymize is disabled
            $domain = gethostbyaddr($this->IP);
            return ($domain == $this->IP) ? '' : $domain;
        }

Posted from SensioLabsInsight