[fix-attachments-php5.5] Fixes attachments processing in php5.5
Merge pull request #1 from theodo/fix-attachments-php5.5

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