Bug when writing a cache file in some cases

Authored by Seb35 on Mar 13 2018, 9:33 AM.

Description

Bug when writing a cache file in some cases

Follow-up of 396257f: when a cache file is overwritten and the new
size is smaller than the old size, the old remaining bits remained,
corrupting the PHP syntax. Added a truncation of the file given the
fopen( …, 'c' ) don’t truncate the file at the contrary of the 'w'
mode ('c' mode is prefered to properly acquire the lock without any
writing).

Change-Id: I8e733905df2d74a97801a5e887e2c12d44a08ebd

Details