[fix-attachments-php5.5] Fixes attachments processing in php5.5