Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use query parameters in install helper function #1618

Merged
merged 1 commit into from Feb 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 10 additions & 8 deletions core/install_helper_functions_api.php
Expand Up @@ -409,10 +409,11 @@ function install_correct_multiselect_custom_fields_db_format() {
$c_bug_id = (int)$t_row['bug_id'];
$c_value = '|' . rtrim( ltrim( $t_row['value'], '|' ), '|' ) . '|';
$t_update_query = 'UPDATE {custom_field_string}
SET value = \'' . $c_value . '\'
WHERE field_id = ' . $c_field_id . '
AND bug_id = ' . $c_bug_id;
db_query( $t_update_query );
SET value = ' . db_param() . '
WHERE field_id = ' . db_param() . '
AND bug_id = ' . db_param();
$t_param = array( $c_value, $c_field_id, $c_bug_id );
db_query( $t_update_query, $t_param );
}

# Remove vertical pipe | prefix and suffix from radio custom field values.
Expand All @@ -429,10 +430,11 @@ function install_correct_multiselect_custom_fields_db_format() {
$c_bug_id = (int)$t_row['bug_id'];
$c_value = rtrim( ltrim( $t_row['value'], '|' ), '|' );
$t_update_query = 'UPDATE {custom_field_string}
SET value = \'' . $c_value . '\'
WHERE field_id = ' . $c_field_id . '
AND bug_id = ' . $c_bug_id;
db_query( $t_update_query );
SET value = ' . db_param() . '
WHERE field_id = ' . db_param() . '
] AND bug_id = ' . db_param();
$t_param = array( $c_value, $c_field_id, $c_bug_id );
db_query( $t_update_query, $t_param );
}

# Re-enable query logging if we disabled it
Expand Down