From 2fc36e82adcf89b863cc6b152832334e35fe7c51 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 5 Sep 2017 21:12:45 +0100 Subject: [PATCH] see #74 - fix undefined $CONF[page_size] --- viewlog.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/viewlog.php b/viewlog.php index 02054839..2add8a8f 100644 --- a/viewlog.php +++ b/viewlog.php @@ -60,9 +60,11 @@ $tLog = array(); if ($error != 1) { $table_log = table_by_key('log'); - $query = "SELECT timestamp,username,domain,action,data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT " . intval($CONF['page_size']); + $page_size = isset($CONF['page_size']) ? intval($CONF['page_size']) : 35; + + $query = "SELECT timestamp,username,domain,action,data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT $page_size"); if (db_pgsql()) { - $query = "SELECT extract(epoch from timestamp) as timestamp,username,domain,action,data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT " . intval($CONF['page_size']); + $query = "SELECT extract(epoch from timestamp) as timestamp,username,domain,action,data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT $page_size"; } $result=db_query($query); if ($result['rows'] > 0)