MantisBT: master-1.2.x 3008c7f7

Author Committer Branch Timestamp Parent
Damien Regad Damien Regad master-1.2.x 2012-08-09 08:36 master-1.2.x 4f4e69bd
Affected Issues  0012955: After updating a project documentation the file is damaged
Changeset

Fix encoding of BLOB columns

The db_prepare_binary_string() function was designed for use with
db_query(), and therefore used to surround the binary string to
encode with single quotes.

Use of db_query_bound() with the function's return value would result in
a corrupted attachment because the quotes would be treated as integral
part of the binary data.

MySQL does not require any special encoding (except regular string
processing which is already done by db_query_bound()).

For PostgreSQL, instead of calling pg_escape_bytea() directly, we now
use ADOdb connection's BlobEncode() method.

MSSQL encoding was left as is was (no test platform available).

Based on documentation, Oracle (oci8) should not require any encoding
either, but was not tested either.

Fixes 0012955

mod - core/database_api.php Diff File