/* Try to find the start of the url by finding any non-urlsafe character or whitespace/punctuation */
while (p >= begin) {
- if (!is_urlsafe (*p) || g_ascii_isspace (*p)) {
+ if ((!is_domain (*p) && *p != '.') || g_ascii_isspace (*p)) {
+ p ++;
+ if (*p == '.') {
+ /* Urls cannot start with . */
+ return FALSE;
+ }
match->m_begin = p;
return TRUE;
}
return FALSE;
}
}
+ if (*pos == '.') {
+ /* Urls cannot start with . */
+ return FALSE;
+ }
match->m_begin = pos;
return TRUE;