# HG changeset patch # User Dan # Date 1223771482 14400 # Node ID 01c6a003d762430498172918d758632d9b330a92 # Parent 5e2d1514ccd084482da379ab7ed3bba9bce280fe Fixed reference to missing key "counts" in stats-fe diff -r 5e2d1514ccd0 -r 01c6a003d762 stats-fe.php --- a/stats-fe.php Sat Oct 11 20:28:32 2008 -0400 +++ b/stats-fe.php Sat Oct 11 20:31:22 2008 -0400 @@ -122,25 +122,28 @@ function stats_merge($data) { global $stats_merged_data; - foreach ( $data['counts'] as $channel => $chaninfo ) + if ( isset($data['counts']) ) { - if ( isset($stats_merged_data['counts'][$channel]) ) + foreach ( $data['counts'] as $channel => $chaninfo ) { - foreach ( $stats_merged_data['counts'][$channel] as $key => &$value ) + if ( isset($stats_merged_data['counts'][$channel]) ) { - if ( is_int($value) ) + foreach ( $stats_merged_data['counts'][$channel] as $key => &$value ) { - $value = max($value, $chaninfo[$key]); - } - else if ( is_array($value) ) - { - $value = array_merge($value, $chaninfo[$key]); + if ( is_int($value) ) + { + $value = max($value, $chaninfo[$key]); + } + else if ( is_array($value) ) + { + $value = array_merge($value, $chaninfo[$key]); + } } } - } - else - { - $stats_merged_data['counts'][$channel] = $chaninfo; + else + { + $stats_merged_data['counts'][$channel] = $chaninfo; + } } } foreach ( $data['messages'] as $channel => $chandata )