CodeSOD: When You Can’t Use WordPress

This post was originally published on this site

The Daily WTF

Initech had a lovely little Content Management System built by a third party that was good at “building” CMSes. That is to say, this company knew its way around a WordPress template.

When Initech needed a new public-facing website, they went straight back to that vendor. Now, this new website was a complicated statistical tool, with all sorts of complicated business rules and requiring a large amount of custom programming. So the vendor that just cranked out WordPress templates may not have been a good fit for the project, but that didn’t stop anybody.

That’s how Magnus M found code which looks like this:

$dataTotalArray[$md[‘adt_group_id’]][$md[‘atss_id’]][‘adt_text’] = $md[‘adt_text’]; if($md[‘type’] == “totalthisyear”) { $dataTotalArray[$md[‘adt_group_id’]][$md[‘atss_id’]][‘amount’] = $md[‘amount’]; $dataTotalArray[$md[‘adt_group_id’]][$md[‘atss_id’]][‘count’] = $md[‘count’]; }

There are so many nested braces here I’d almost suspect this was a LISP dialect instead of PHP.

That’s just ugly and incomprehensible, and it isn’t the WTF. The real WTF

To read the full article click on the 'post' link at the top.