MantisBT: master-1.2.x e9260b14

Author Committer Branch Timestamp Parent
dregad dregad master-1.2.x 2015-12-06 06:59 master-1.2.x a805f6e7
Affected Issues  0020340: Attachment is saved to disk and database at the same time
Changeset

Fix 2-byte attachment saved to DB when upload_method is DISK

Commit 4f4e69bd73e2840ce4542072bb544f51ddaf3cf7 changed file_add() to
use bind parameters, but failed to remove quotes escaping of $c_content
variable.

This results in an invalid 2-byte attachment (containing 2 single
quotes "''") being stored in the file table in addition to the one saved
to disk as expected, which does not actually have any impact unless the
admin tries to move attachments from DB to disk; in that case, the valid
files are overwritten, causing loss of data.

The problem is fixed by setting $c_content to an empty string.

Previously fixed in master branch commit
02bbb99501c48f89ad249fb505dc9bba93bae5c0

Fixes 0020340

mod - core/file_api.php Diff File