mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
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
This commit is contained in:
parent
be2c4c7d85
commit
1d655f2f3e
1 changed files with 5 additions and 4 deletions
|
@ -383,15 +383,16 @@ class custom_profile
|
||||||
break;
|
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)
|
foreach ($cp_data as $key => $value)
|
||||||
{
|
{
|
||||||
// Firebird is case sensitive with delimiter
|
// Firebird is case sensitive with delimiter
|
||||||
$cp_data[$left_delim . (($db->sql_layer == 'firebird' || $db->sql_layer == 'oracle') ? strtoupper($key) : $key) . $right_delim] = $value;
|
$cp_data_sql[$left_delim . (($db->sql_layer == 'firebird' || $db->sql_layer == 'oracle') ? strtoupper($key) : $key) . $right_delim] = $value;
|
||||||
unset($cp_data[$key]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
|
$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";
|
WHERE user_id = $user_id";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -401,7 +402,7 @@ class custom_profile
|
||||||
|
|
||||||
$db->sql_return_on_error(true);
|
$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_query($sql);
|
||||||
|
|
||||||
$db->sql_return_on_error(false);
|
$db->sql_return_on_error(false);
|
||||||
|
|
Loading…
Add table
Reference in a new issue