aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/profilefields/profilefields.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-01-14 13:38:24 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-01-14 13:38:24 +0100
commitd601aaad263e19b47865bca56da527f4fdf504e1 (patch)
tree6c942af03a1536ebd99a942c7f04f72b36cd28e3 /phpBB/phpbb/profilefields/profilefields.php
parentdaf21fcb30c5c76c1d3f0b2a2bce8d8c1d8aed14 (diff)
downloadforums-d601aaad263e19b47865bca56da527f4fdf504e1.tar
forums-d601aaad263e19b47865bca56da527f4fdf504e1.tar.gz
forums-d601aaad263e19b47865bca56da527f4fdf504e1.tar.bz2
forums-d601aaad263e19b47865bca56da527f4fdf504e1.tar.xz
forums-d601aaad263e19b47865bca56da527f4fdf504e1.zip
[ticket/11201] Remove type related code from build_insert_sql_array()
PHPBB3-11201
Diffstat (limited to 'phpBB/phpbb/profilefields/profilefields.php')
-rw-r--r--phpBB/phpbb/profilefields/profilefields.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/phpBB/phpbb/profilefields/profilefields.php b/phpBB/phpbb/profilefields/profilefields.php
index ba0baa53f0..e3201712df 100644
--- a/phpBB/phpbb/profilefields/profilefields.php
+++ b/phpBB/phpbb/profilefields/profilefields.php
@@ -408,18 +408,8 @@ class profilefields
while ($row = $this->db->sql_fetchrow($result))
{
- if ($row['field_default_value'] == 'now' && $row['field_type'] == FIELD_DATE)
- {
- $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'];
+ $profile_field = $this->container->get('profilefields.type.' . $this->profile_types[$row['field_type']]);
+ $cp_data['pf_' . $row['field_ident']] = $profile_field->get_default_field_value($row);
}
$this->db->sql_freeresult($result);