Fixes #8326: deletion of directories on S3
Converted an array to PHP5.3 compatible version
Merge branch 'fix-8326' into fix-9650