Skip to content

Commit

Permalink
Fix file attachment for PostgreSQL
Browse files Browse the repository at this point in the history
Use of an associative array causes issues with pgsql as it expects a
0-based numeric array for the query parameters.

Issue #20547
  • Loading branch information
dregad committed Feb 5, 2016
1 parent a3e52aa commit c7a47d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/soap/mc_file_api.php
Expand Up @@ -165,7 +165,7 @@ function mci_file_add( $p_id, $p_name, $p_content, $p_file_type, $p_table, $p_ti
( ' . implode(', ', array_keys( $t_param ) ) . ' )
VALUES
( ' . $t_query_param . ' )';
db_query( $t_query, $t_param );
db_query( $t_query, array_values( $t_param ) );

# get attachment id
$t_attachment_id = db_insert_id( $t_file_table );
Expand Down
2 changes: 1 addition & 1 deletion core/file_api.php
Expand Up @@ -747,7 +747,7 @@ function file_add( $p_bug_id, array $p_file, $p_table = 'bug', $p_title = '', $p
( ' . implode(', ', array_keys( $t_param ) ) . ' )
VALUES
( ' . $t_query_param . ' )';
db_query( $t_query, $t_param );
db_query( $t_query, array_values( $t_param ) );

if( db_is_oracle() ) {
db_update_blob( $t_file_table, 'content', $c_content, "diskfile='$t_unique_name'" );
Expand Down

0 comments on commit c7a47d3

Please sign in to comment.