From 87f145291943f3fbcbf315e0b487e8082361d5dc Mon Sep 17 00:00:00 2001 From: james Date: Thu, 20 Dec 2007 18:00:30 +0000 Subject: [PATCH] Fix invalid type. type="" is valid because of custom reports. Same for stock. --- admin/reports.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/admin/reports.php b/admin/reports.php index 1dd8f6de..9f937ff2 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -63,19 +63,17 @@ if($category) { $type = $_POST['type']; - if(!array_key_exists($type, $report_options['type']['values'])) { - /* Invalid format, not possible unless someone manually - * changes the POST variable */ - echo "Invalid format"; - exit; - } $stock = $_POST['stock']; - if(!array_key_exists($stock, $report_stock)) { - /* Invalid format, not possible unless someone manually - * changes the POST variable */ - echo "Invalid stock"; + /* + if(!array_key_exists($type, $report_options['type']['values'])) { + echo "Invalid format: type=$type"; exit; } + if(!array_key_exists($stock, $report_stock)) { + echo "Invalid stock: stock=$stock"; + exit; + } + */ mysql_query("INSERT INTO `reports_committee` (`id`, `users_id` , `reports_id` , `category` , `comment` , `format` , `stock`)