From 873dd96927bf8014817f6561cb8a5f636e8454e5 Mon Sep 17 00:00:00 2001 From: NOYB Date: Thu, 17 Dec 2015 17:41:31 -0800 Subject: Status - System Logs - Manage Log - Input Validation Add input validation at form level in browser. Keep PHP server side validation so as not to rely solely on the browser. --- src/usr/local/www/status_logs.php | 4 ++-- src/usr/local/www/status_logs_filter.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/status_logs.php b/src/usr/local/www/status_logs.php index 5c2c39a..0e0e5f4 100755 --- a/src/usr/local/www/status_logs.php +++ b/src/usr/local/www/status_logs.php @@ -571,7 +571,7 @@ $group->add(new Form_Input( 'GUI Log Entries', 'number', $pconfig['nentries'], - ['placeholder' => $config['syslog']['nentries']] + ['min' => 5, 'placeholder' => $config['syslog']['nentries']] ))->setWidth(2); $group->setHelp('This is the number of log entries displayed in the GUI. It does not affect how many entries are contained in the log.'); @@ -585,7 +585,7 @@ $group->add(new Form_Input( 'Log file size (Bytes)', 'number', $pconfig['logfilesize'], - ['placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"] + ['min' => 100000, 'placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"] ))->setWidth(2); $group->setHelp("The log is held in a constant-size circular log file. This field controls how large the log file is, and thus how many entries may exist inside the log. The default is approximately 500KB." . '

' . diff --git a/src/usr/local/www/status_logs_filter.php b/src/usr/local/www/status_logs_filter.php index e3050d6..ca031de 100644 --- a/src/usr/local/www/status_logs_filter.php +++ b/src/usr/local/www/status_logs_filter.php @@ -818,7 +818,7 @@ $group->add(new Form_Input( 'GUI Log Entries', 'number', $pconfig['nentries'], - ['placeholder' => $config['syslog']['nentries']] + ['min' => 5, 'placeholder' => $config['syslog']['nentries']] ))->setWidth(2); $group->setHelp('This is the number of log entries displayed in the GUI. It does not affect how many entries are contained in the log.'); @@ -832,7 +832,7 @@ $group->add(new Form_Input( 'Log file size (Bytes)', 'number', $pconfig['logfilesize'], - ['placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"] + ['min' => 100000, 'placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"] ))->setWidth(2); $group->setHelp("The log is held in a constant-size circular log file. This field controls how large the log file is, and thus how many entries may exist inside the log. The default is approximately 500KB." . '

' . -- cgit v1.1