Fixes #8326: deletion of directories on S3
Converted an array to PHP5.3 compatible version