Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

#652 - Fix for other negative values on admin pages

  • Loading branch information...
commit 323c556cccbf4c3c01b880cdffa2e9154d665205 1 parent 1b5334c
Jan Dorsman authored April 07, 2012
8  admin_groups.php
@@ -267,10 +267,10 @@
267 267
 	$search = isset($_POST['search']) ? intval($_POST['search']) : '1';
268 268
 	$search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1';
269 269
 	$send_email = (isset($_POST['send_email']) && $_POST['send_email'] == '1') || $is_admin_group ? '1' : '0';
270  
-	$post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0';
271  
-	$search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0';
272  
-	$email_flood = isset($_POST['email_flood']) ? intval($_POST['email_flood']) : '0';
273  
-	$report_flood = isset($_POST['report_flood']) ? intval($_POST['report_flood']) : '0';
  270
+	$post_flood = (isset($_POST['post_flood']) && $_POST['post_flood'] >= 0) ? intval($_POST['post_flood']) : '0';
  271
+	$search_flood = (isset($_POST['search_flood']) && $_POST['search_flood'] >= 0) ? intval($_POST['search_flood']) : '0';
  272
+	$email_flood = (isset($_POST['email_flood']) && $_POST['email_flood'] >= 0) ? intval($_POST['email_flood']) : '0';
  273
+	$report_flood = (isset($_POST['report_flood']) && $_POST['report_flood'] >= 0) ? intval($_POST['report_flood']) : '0';
274 274
 
275 275
 	if ($title == '')
276 276
 		message($lang_admin_groups['Must enter title message']);
4  admin_permissions.php
@@ -28,6 +28,10 @@
28 28
 
29 29
 	foreach ($form as $key => $input)
30 30
 	{
  31
+		// Make sure the input is never a negative value
  32
+		if($input < 0)
  33
+			$input = 0;
  34
+
31 35
 		// Only update values that have changed
32 36
 		if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
33 37
 			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());

0 notes on commit 323c556

Please sign in to comment.
Something went wrong with that request. Please try again.