aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-11-07 00:03:15 +0100
committerNils Adermann <naderman@naderman.de>2010-11-07 00:03:15 +0100
commitf7180f44303e441005f0b1f4d652657b9f406642 (patch)
tree5b46bb57be37d6e92ed2f76b24fca30faca9f6ac /phpBB/includes
parent516282dfa9f07bc0534f260462eceabc5531d33b (diff)
parentec3dac0595ea1a6c7071f16fca9e3373bd4027d4 (diff)
downloadforums-f7180f44303e441005f0b1f4d652657b9f406642.tar
forums-f7180f44303e441005f0b1f4d652657b9f406642.tar.gz
forums-f7180f44303e441005f0b1f4d652657b9f406642.tar.bz2
forums-f7180f44303e441005f0b1f4d652657b9f406642.tar.xz
forums-f7180f44303e441005f0b1f4d652657b9f406642.zip
Merge branch 'ticket/bantu/9075' into develop-olympus
* ticket/bantu/9075: [ticket/9075] CPF Numbers fields: Prevent SQL error on registration page.
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_profile_fields.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 3937cf9c21..78fe049f40 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -878,6 +878,11 @@ class custom_profile
$now = getdate();
$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'];
}