Index: extlink.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/extlink/extlink.js,v
retrieving revision 1.4.2.9
diff -u -r1.4.2.9 extlink.js
--- extlink.js	20 Dec 2009 00:20:25 -0000	1.4.2.9
+++ extlink.js	7 May 2010 21:20:59 -0000
@@ -2,9 +2,10 @@
 (function ($) {
 
 function extlinkAttach(context) {
-  // Strip the host name down, removing subdomains or www.
-  var host = window.location.host.replace(/^(([^\/]+?\.)*)([^\.]{4,})((\.[a-z]{1,4})*)$/, '$3$4');
-  var subdomain = window.location.host.replace(/^(([^\/]+?\.)*)([^\.]{4,})((\.[a-z]{1,4})*)$/, '$1');
+  // Strip the host name down, removing ports, subdomains, or www.
+  var pattern = /^(([^\/:]+?\.)*)([^\.:]{4,})((\.[a-z]{1,4})*)(:[0-9]{1,5})?$/;
+  var host = window.location.host.replace(pattern, '$3$4');
+  var subdomain = window.location.host.replace(pattern, '$1');
 
   // Determine what subdomains are considered internal.
   if (Drupal.settings.extlink.extSubdomains) {
