diff options
author | Henry Sudhof <kellanved@phpbb.com> | 2009-07-06 13:42:15 +0000 |
---|---|---|
committer | Henry Sudhof <kellanved@phpbb.com> | 2009-07-06 13:42:15 +0000 |
commit | 1d655f2f3e61a673573e5ea3cc863e34a1bb8eaa (patch) | |
tree | 9a9a61e43e1e52383305bc2382aa390a0826da02 /phpBB/includes/functions_profile_fields.php | |
parent | be2c4c7d85abc4e6c96c5c69263a6b7f51d68660 (diff) | |
download | forums-1d655f2f3e61a673573e5ea3cc863e34a1bb8eaa.tar forums-1d655f2f3e61a673573e5ea3cc863e34a1bb8eaa.tar.gz forums-1d655f2f3e61a673573e5ea3cc863e34a1bb8eaa.tar.bz2 forums-1d655f2f3e61a673573e5ea3cc863e34a1bb8eaa.tar.xz forums-1d655f2f3e61a673573e5ea3cc863e34a1bb8eaa.zip |
Fix an endless loop; don't return the sql array by reference
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9716 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_profile_fields.php')
-rw-r--r-- | phpBB/includes/functions_profile_fields.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index bb54e0de5b..abdae926bd 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -383,15 +383,16 @@ class custom_profile break; } + // use new array for the UPDATE; changes in the key do not affect the original array + $cp_data_sql = array(); foreach ($cp_data as $key => $value) { // Firebird is case sensitive with delimiter - $cp_data[$left_delim . (($db->sql_layer == 'firebird' || $db->sql_layer == 'oracle') ? strtoupper($key) : $key) . $right_delim] = $value; - unset($cp_data[$key]); + $cp_data_sql[$left_delim . (($db->sql_layer == 'firebird' || $db->sql_layer == 'oracle') ? strtoupper($key) : $key) . $right_delim] = $value; } $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $cp_data) . " + SET ' . $db->sql_build_array('UPDATE', $cp_data_sql) . " WHERE user_id = $user_id"; $db->sql_query($sql); @@ -401,7 +402,7 @@ class custom_profile $db->sql_return_on_error(true); - $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); + $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data_sql); $db->sql_query($sql); $db->sql_return_on_error(false); |