Decoding Nested gz base64 code

Whenever I first install any theme, I make my own modifications.  Sometimes  it’s removing extraneous code that I won’t be using, or changing the size of certain sections, or adding in some calls that I do need.  Whenever I do this I always modify the footer to say ‘Modified by Randy Aldrich.’

Recently After modifying the theme to my liking I went to add my own footer only to find the Author had used gz compression and base64 encoding on the footer.  All I found was the following code:


This was obviously an attempt to protect the author’s copyright on the theme.  However; as I heavily modified the original results, I felt the need to protect my own and so I found a solution to decode the footer.

If you run into this same problem, just place the eval code you found into a file called coded.txt.  Then all you need to do is run this decrypt.php PHP script from the same directory and decoded.txt will be created in the same directory and will contain the decoded code.

NOTE: This solution is not mine, it was found on the web at Taree Internet

It's the Variable Noob!

I’ve seen a lot of crazy code in the past few years but this one takes the cake. The project I was working several years ago was developed while the developers at my company switched to Java. I’m not sure if that excuses the following or not but it’s at least an attempt.

return (test == true) ? ((test != false) ? true : false) : ((test == false) ? false : true);

Just for the record this whole line equates to:

return test;

Hopefully the compiler is good enough to figure that out but even so it’s a lot of ridiculous confusing code to accomplish something pretty basic and fundamental to any language. The sad part is this line of code wasn’t just found in one place, I found it literally everywhere a boolean value was returned.

I wonder what I’ll find in a few years when I look back at code I wrote?