Added default value for group weight

This commit is contained in:
Dmitriy Simushev 2012-02-24 14:50:52 +00:00
parent 0802ce8993
commit a5243fa1f3

View File

@ -100,9 +100,12 @@ if (isset($_POST['name'])) {
if ($email != '' && !is_valid_email($email)) if ($email != '' && !is_valid_email($email))
$errors[] = wrong_field("form.field.mail"); $errors[] = wrong_field("form.field.mail");
if (! preg_match("/^\d{1,9}$/", $weight)) if (! preg_match("/^(\d{1,9})?$/", $weight))
$errors[] = wrong_field("form.field.groupweight"); $errors[] = wrong_field("form.field.groupweight");
if ($weight == '')
$weight = 0;
if (! $parentgroup) if (! $parentgroup)
$parentgroup = NULL; $parentgroup = NULL;