From 71f2e3fd6db43df4b9ea3bce007987f1d4ab4374 Mon Sep 17 00:00:00 2001 From: Daniel Richman Date: Fri, 2 Sep 2011 12:07:25 +0100 Subject: [PATCH] Forbid zero or negative ascent/descent rates --- predict/includes/functions.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/predict/includes/functions.inc.php b/predict/includes/functions.inc.php index cd21e54..f7599c0 100644 --- a/predict/includes/functions.inc.php +++ b/predict/includes/functions.inc.php @@ -81,6 +81,12 @@ function verifyModel( $pred_model, $software_available ) { $return_array['msg'] = "The latitude or longitude deltas were outside the allowed range on this server"; } + } else if ( $idx == "asc" || $idx == "des" ) { + if ( $value <= 0 ) { + $return_array['valid'] = false; + $return_array['msg'] = "The ascent and descent rates cannot + be zero or negative"; + } } else if ( !is_numeric( $value ) ) { $return_array['valid'] = false; $return_array['msg'] = "A value that should have been numeric