article thumbnail

CodeSOD: Delectable Code

The Daily WTF

Take this delectable PHP nugget, from Nathaniel P , who has previously been tortured by bad date handling. Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Good method names are one of the primary ways to write self-documenting code. Honestly, this function needs to be delected.

PHP 64
article thumbnail

CodeSOD: Route to Success

The Daily WTF

Imagine you're building a PHP web application, and you need to display different forms on different pages. Now, for most of us, we'd likely be using some framework to solve this problem, but even if we weren't, the obvious solution of "use a different PHP file for each screen" is a fairly obvious solution.

PHP 60
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

CodeSOD: Default Actions

The Daily WTF

Bleu supports a Pimcore-based PHP site. Pimcore is a rather sprawling enterprise system for PHP. Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Like many Model-View-Controller type frameworks, maps HTTP requests to actions on controllers. Learn more.

PHP 60
article thumbnail

Multilingual Development

The Daily WTF

You see, Bert was a PHP developer. He was building a PHP application. But he copy/pasted Lisa's Java code into a PHP file, and then remangled it until it was executable PHP. Much of his frustration was rooted in the fact that her code didn't even run when he copy/pasted it into a PHP file. Advertisement].

article thumbnail

CodeSOD: Randomly Switching Images

The Daily WTF

Now, I wasn't certain if PHP's rand function was inclusive or not, so I had to look up the documentation to see if there was a bug in this code. There is not, but the PHP rand page is plastered with warnings and caveats. The fact that it's not cryptographically secure is worth noting, but absolutely reasonable.

PHP 52
article thumbnail

CodeSOD: Constant Success

The Daily WTF

Dan was reviewing some PHP code written by a co-worker, as part of taking on a project. Advertisement]. ProGet’s got you covered with security and access controls on your NuGet feeds. One of those “not absolutely necessary” bugs was that sometimes, it just didn’t save data. This code had been in production for years.

article thumbnail

CodeSOD: The Secure Cloud API

The Daily WTF

Melinda's team built a PHP front-end that could not only manage files, but also allowed administrators to manage those quotas. That looked like a security key for their cloud API, transmitted in the open. The developer behind this wrote their own security model, instead of using the one their storage provider offered.

Cloud 63