Initialized logs array
authorJean-Michel Vourgère <jvourger@greenpeace.org>
Wed, 8 Mar 2017 09:09:15 +0000 (09:09 +0000)
committerJean-Michel Vourgère <jvourger@greenpeace.org>
Thu, 9 Mar 2017 18:06:31 +0000 (18:06 +0000)
This avoids warnings when an entry is empty

webroot/squasher.class.php

index 7e438b04b3802d2b331c872091775d5481807863..86e1cbb327a475a40b13fe2a3d9168577a140eb5 100644 (file)
@@ -142,7 +142,12 @@ function get_logs($type='all') {
 
        $order=" ORDER BY log.log_id desc ";
        $r = mysql_query($q.$today.$order);
-       $return = array();
+       $return = array(
+               'today'=>array(),
+               'yesterday'=>array(),
+               'lastweek'=>array(),
+               'older'=>array(),
+               );
        while($a = mysql_fetch_array($r)) {
                $qu="SELECT users.user_name FROM users LEFT JOIN log ON users.user_id = log.user_id WHERE log.ip='".mysql_escape_string($a['ip'])."' GROUP BY users.user_name";
                $ru = mysql_query($qu);