{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiezrzebirqrfkbbh4iqppsz4dkxpbannuumhys323bake4c3xgzwu",
    "uri": "at://did:plc:vyjlfm46mfv6u4vjp6qtrfx2/app.bsky.feed.post/3mmu4wi24or72"
  },
  "coverImage": {
    "$type": "blob",
    "ref": {
      "$link": "bafkreidg2k33tiuupnstmiowh7hyyvtsbe3gyhfygiytrzynysnhoctrxi"
    },
    "mimeType": "image/jpeg",
    "size": 81260
  },
  "path": "/articles/are-there-files-yet",
  "publishedAt": "2026-05-27T06:30:00.000Z",
  "site": "https://thedailywtf.com",
  "tags": [
    "CodeSOD",
    "Utilize BuildMaster",
    "Download"
  ],
  "textContent": "Are there any files to send? That's the question that **Chris C** 's predecessor had. So they asked it. Again. And again. And _again_.\n\nChris writes:\n\n> I'm occasionally called upon to troubleshoot an ecommerce application that was built in the PHP 5.x days and has been running largely untroubled by maintenance or modernity (aside from the backported security patches to its binaries) ever since.\n\n\n    if(sizeof($files) > 0){\n    \t\tif(sizeof($files) > 0){\n    \t\t\t\tforeach($files as $file){\n    \t\t\t\t\t\t$mime->addAttachment($file);\n    \t\t}\n    \t\t}\n    }\n\n\nIndentation as per the original.\n\nIf the files array contains items, then if the files array contains items, then we iterate across the files array, which hopefully contains items, and add them as an attachment to an email.\n\nI feel like the way this got indented, the developer responsible knew, deep down, that this was wrong. They lacked the reading comprehension to understand why, but deep down in their spleen, something was screaming at them. And thus those stacked curly brackets at the end there.\n\nOf course, none of the conditionals are needed: a foreach on an empty object just does nothing.\n\n[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!",
  "title": "CodeSOD: Are There Files Yet?"
}