You are currently browsing the by Vernon Kesner weblog archives for April, 2007.

0

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Thanks to ZDNet for this post on exploit code that’s been made publically available for a serious security flaw in Photoshop. This flaw could allow attackers to take complete control of your Windows machine, according to an advisory from FrSIRT.

The flaw, rated critical, is caused by buffer overflow errors when handling a malformed “BMP”, “DIB” or “RLE” file.

“This could be exploited by attackers to take complete control of an affected system by tricking a user into opening a specially crafted file using a vulnerable application,” FrSIRT said.

The exploit code, available at Milw0rm.com, has been successfully tested against Windows XP Service Pack 2.

As of now, there are no patches available for these vulnerabilities. Of course always apply the common sense approach, “Don’t open files from sources you don’t trust”.

0

Finding the time to write
April 9th, 2007

As you notice, I haven’t been posting a ton over the past few weeks. It’s not because I don’t have anything to write about, or that I don’t want to. In fact, I’d love to!

Of course, we all know that business comes first. I write on here as a way to share things I come across that I think would be helpful to other designers and developer. This blog is an outlet for me and something I do as a hobby.

I’ve been working as a full-time designer/developer (yes I do both!) since 2002 and things are going great! That’s the reason for the lack of posting going on lately. (Remember the “business comes first” part earlier?)

I’m working on 12 different projects now and it seems like a new one comes in every day or so. Which is great! Unfortunately, it doesn’t leave me with any time to post around here.

Hopefully I’ll be able to plan my schedule out a little better so I can get back to posting at least a few times a week. Let me tell you, my moleskin planner is definitely getting a workout!

0

PHP Email Address Encoder
April 4th, 2007

This small PHP function will give you an easy way to encode any email address using Character Entities. Just supply the function call with an email address and get the encoded version returned. Most any browser will properly read and translate your email without a problem and without any further action on your part.

Just make a nice call to the function whenever you want to show your email. Such as...

PHP:
  1. <a href="mailto:<?php encode_email('you@yourdomain.com'); ?>"><?php encode_email('you@yourdomain.com'); ?></a>

Here's the function code:

PHP:
  1. <?php
  2. function encode_email($email) {
  3.     //transform email to lowercase
  4.     $email = strtolower($email);
  5.     //separate characters of email into an array
  6.     // str_split() only available in PHP 5
  7.     $email = str_split($email);
  8.     //loop through string and encode as necessary
  9.     foreach($email as $ekey => $evalue) {
  10.         switch($evalue) {
  11.             case 'a':
  12.                 $encoded_email .= "&#097;";
  13.                 break;
  14.             case 'b':
  15.                 $encoded_email .= "&#098;";
  16.                 break;
  17.             case 'c':
  18.                 $encoded_email .= "&#099;";
  19.                 break;
  20.             case 'd':
  21.                 $encoded_email .= "&#100;";
  22.                 break;
  23.             case 'e':
  24.                 $encoded_email .= "&#101;";
  25.                 break;
  26.             case 'f':
  27.                 $encoded_email .= "&#102;";
  28.                 break;
  29.             case 'g':
  30.                 $encoded_email .= "&#103;";
  31.                 break;
  32.             case 'h':
  33.                 $encoded_email .= "&#104;";
  34.                 break;
  35.             case 'i':
  36.                 $encoded_email .= "&#105;";
  37.                 break;
  38.             case 'j':
  39.                 $encoded_email .= "&#106;";
  40.                 break;
  41.             case 'k':
  42.                 $encoded_email .= "&#107;";
  43.                 break;
  44.             case 'l':
  45.                 $encoded_email .= "&#108;";
  46.                 break;
  47.             case 'm':
  48.                 $encoded_email .= "&#109;";
  49.                 break;
  50.             case 'n':
  51.                 $encoded_email .= "&#110;";
  52.                 break;
  53.             case 'o':
  54.                 $encoded_email .= "&#111;";
  55.                 break;
  56.             case 'p':
  57.                 $encoded_email .= "&#112;";
  58.                 break;
  59.             case 'q':
  60.                 $encoded_email .= "&#113;";
  61.                 break;
  62.             case 'r':
  63.                 $encoded_email .= "&#114;";
  64.                 break;
  65.             case 's':
  66.                 $encoded_email .= "&#115;";
  67.                 break;
  68.             case 't':
  69.                 $encoded_email .= "&#116;";
  70.                 break;
  71.             case 'u':
  72.                 $encoded_email .= "&#117;";
  73.                 break;
  74.             case 'v':
  75.                 $encoded_email .= "&#118;";
  76.                 break;
  77.             case 'w':
  78.                 $encoded_email .= "&#119;";
  79.                 break;
  80.             case 'x':
  81.                 $encoded_email .= "&#120;";
  82.                 break;
  83.             case 'y':
  84.                 $encoded_email .= "&#121;";
  85.                 break;
  86.             case 'z':
  87.                 $encoded_email .= "&#122;";
  88.                 break;
  89.             case '0':
  90.                 $encoded_email .= "&#048;";
  91.                 break;
  92.             case '1':
  93.                 $encoded_email .= "&#049;";
  94.                 break;
  95.             case '2':
  96.                 $encoded_email .= "&#050;";
  97.                 break;
  98.             case '3':
  99.                 $encoded_email .= "&#051;";
  100.                 break;
  101.             case '4':
  102.                 $encoded_email .= "&#052;";
  103.                 break;
  104.             case '5':
  105.                 $encoded_email .= "&#053;";
  106.                 break;
  107.             case '6':
  108.                 $encoded_email .= "&#054;";
  109.                 break;
  110.             case '7':
  111.                 $encoded_email .= "&#055;";
  112.                 break;
  113.             case '8':
  114.                 $encoded_email .= "&#056;";
  115.                 break;
  116.             case '9':
  117.                 $encoded_email .= "&#057;";
  118.                 break;
  119.             case '&':
  120.                 $encoded_email .= "&#038;";
  121.                 break;
  122.             case ' ':
  123.                 $encoded_email .= "&#032;";
  124.                 break;
  125.             case '_':
  126.                 $encoded_email .= "&#095;";
  127.                 break;
  128.             case '-':
  129.                 $encoded_email .= "&#045;";
  130.                 break;
  131.             case '@':
  132.                 $encoded_email .= "&#064;";
  133.                 break;
  134.             case '.':
  135.                 $encoded_email .= "&#046;";
  136.                 break;
  137.         }
  138.     }
  139.     //echo encoded email
  140.     echo $encoded_email;
  141. }
  142. ?>

A little about Vernon...

Hey there everybody, I’m Vernon. I’ve been a full-time freelance web designer since 2002 and can honestly say it’s been a great journey.

If you’re interested, take a look at my services site and let me help you with your project.