Wassup Jose Weblog nonsense at its best!

21Oct/081

Daily WTF PHP

I recall seeing a similar jewel on the Daily WTF site some time ago, it was hilarious then and still stupid to this date. Last night, I was updating a new proxy site for our friend Sum Yum and BAM! A candidate for the Daily WTF site before my very eyes.

Check it out readers! The images are base64 encoded and somehow the author convinces himself that this is a good thing. Let me see, I need to maintain the images. What folder are they in? There is no images folder, because the images are encoded in the PHP file!

IMAGES (ugly but keeps it in a single file)

if ( isset($_GET['image']) ) {

// Send image function
function sendImage($str) {
header('Content-Type: image/gif');
header('Last-Modified: ' . gmdate("D, d M Y H:i:s", filemtime(__FILE__)) . 'GMT');
header('Expires: ' . gmdate("D, d M Y H:i:s", filemtime(__FILE__) + (60*60)) . 'GMT');
echo base64_decode($str);
exit;
}

switch ( $_GET['image'] ) {
case 'bg.gif':
sendImage('R0lGODlhkAMMAMQAAP////7+/v3+/fz9/Pr7+vn6+...');
break;
case 'button.gif':
sendImage('R0lGODlhCgAoAKIAAOno6Ovq6/f39////+vp6vPx8u...');
break;
case 'footer.gif':
sendImage('R0lGODlhkAMwAOYAAP////7+/v39/f3+/fz9/Pz8/Pv...');
break;
case 'loading.gif':
sendImage('R0lGODlhEAAQAPIAAP///2ZmZtra2o2NjWZmZqCgo...');
break;
}

}

Comments (1) Trackbacks (0)
  1. what the crap?


Leave a comment

(required)

 

No trackbacks yet.