mirror of
https://github.com/makew0rld/amfora.git
synced 2024-12-04 14:46:29 -05:00
This commit is contained in:
parent
e432e28003
commit
40f55d894b
@ -215,9 +215,10 @@ func Init(version, commit, builtBy string) {
|
||||
// We don't want to convert legitimate
|
||||
// :// links to search terms.
|
||||
query := strings.TrimSpace(query)
|
||||
if (strings.Contains(query, " ") && !hasSpaceisURL.MatchString(query)) ||
|
||||
if ((strings.Contains(query, " ") && !hasSpaceisURL.MatchString(query)) ||
|
||||
(!strings.HasPrefix(query, "//") && !strings.Contains(query, "://") &&
|
||||
!strings.Contains(query, ".")) && !strings.HasPrefix(query, "about:") {
|
||||
!strings.Contains(query, ".")) && !strings.HasPrefix(query, "about:")) &&
|
||||
!(query == "localhost" || strings.HasPrefix(query, "localhost/") || strings.HasPrefix(query, "localhost:")) {
|
||||
// Has a space and follows regex, OR
|
||||
// doesn't start with "//", contain "://", and doesn't have a dot either.
|
||||
// Then it's a search
|
||||
|
Loading…
Reference in New Issue
Block a user