diff -u b/link.module b/link.module --- b/link.module +++ b/link.module @@ -1191,9 +1191,10 @@ * True if a valid link, FALSE otherwise. */ function link_validate_url($text, $langcode = NULL) { + $text = link_cleanup_url($text); $type = link_url_type($text); - if ($type && ($type == LINK_INTERNAL || $type == LINK_INTERNAL)) { + if ($type && ($type == LINK_INTERNAL || $type == LINK_EXTERNAL)) { $flag = valid_url($text, TRUE); if (!$flag) { $normal_path = drupal_get_normal_path($text, $langcode); diff -u b/tests/link.validate.test b/tests/link.validate.test --- b/tests/link.validate.test +++ b/tests/link.validate.test @@ -457,7 +457,6 @@ 'http://255.255.255.255:4823/', 'www.test-site.com', 'http://example.com/index.php?q=node/123', - 'http://example.com/index.php?page=this\that', 'http://example.com/?first_name=Joe Bob&last_name=Smith', // Anchors 'http://www.example.com/index.php#test', @@ -498,6 +497,8 @@ 'http://www.testß.com/', // ß not allowed in domain names! 'http://www.example.frog/', // Bad TLD //'http://www.-fudge.com/', // domains can't have sections starting with a dash. + 'http://example.com/index.php?page=this\that', + 'example@example.com', ); foreach ($links as $link) { $valid = link_validate_url($link);