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 modules/ModuleDlstatsStatistics.php, line 143 #66

Closed BugBuster1701 closed 9 years ago

BugBuster1701 commented 9 years ago

in modules/ModuleDlstatsStatistics.php, line 143

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

     * @return string
     */
    protected function getStatusCounting()
    {
        if ( isset($GLOBALS['TL_CONFIG']['dlstats']) 
                && $GLOBALS['TL_CONFIG']['dlstats'] == true  
           ) 
        {
            return '<span class="tl_green">'.$GLOBALS['TL_LANG']['tl_dlstatstatistics_stat']['status_activated'].'</span>';
        }
        return '<span class="tl_red">'.$GLOBALS['TL_LANG']['tl_dlstatstatistics_stat']['status_deactivated'].'</span>';

Posted from SensioLabsInsight