buddycloud/buddycloud-webclient — pull request #63 by Schnouki (2012-03-07 08:47:39+00:00)
Title: Make sure links in posts have a protocol part

Short URLs (like ur1.ca/8jzl0 or t.co/DEG1zgjc) are correctly detected as URLs, but there is a little issue when they are rendered in a post: since they don't have a protocol part, browsers consider them as relative paths. So they are turned into links to http://example.com/ur1.ca/8jzl0, which obviously does not work.
This commit changes this behavior by trying to detect an procol part in the beginning of a link and adding "http://" if no protocol part can be found.

This could also be done in the scary URL regex, but it would probably be more complicated, and it would change what the user sees (http://ur1.ca/... vs ur1.ca/...).