Expand URL
The popularity of short URL services, like tinyurl.com and bit.ly, has grown due to the character limits of Twitter. These services pose a security risk because they could be used to conceal the addresses malicious sites. Users are being taught to trust all URLs and just blindly click. Sites like Twitter should offer users the ability to expand these short URLs so the user can quickly verify the trust worthiness.
Below is a sample php function that expands URLs. As you can see the function is extremely simple and only takes two lines of code (the rest of the code is a use example). I hope large sites will adopt similar functionality before novice users become accustomed to blindly clicking obfuscated links.
<?php
$url = “http://bit.ly/4t9IYV”;
$fullURL = expandURL($url);
echo “Short URL: $url”;
echo “Original URL:”.$fullURL;function expandURL( $url )
{
$fullURL = get_headers($url,1);
return $fullURL[‘Location’];
}
?>
Leave a Reply