mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 14:48:53 +00:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/9075] CPF Numbers fields: Prevent SQL error on registration page.
This commit is contained in:
commit
7ca6377892
1 changed files with 5 additions and 0 deletions
|
@ -879,6 +879,11 @@ class custom_profile
|
||||||
$now = getdate();
|
$now = getdate();
|
||||||
$row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
|
$row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
|
||||||
}
|
}
|
||||||
|
else if ($row['field_default_value'] === '' && $row['field_type'] == FIELD_INT)
|
||||||
|
{
|
||||||
|
// We cannot insert an empty string into an integer column.
|
||||||
|
$row['field_default_value'] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
$cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
|
$cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue