mirror of
https://github.com/makew0rld/amfora.git
synced 2024-09-11 05:55:27 +03: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
|
// We don't want to convert legitimate
|
||||||
// :// links to search terms.
|
// :// links to search terms.
|
||||||
query := strings.TrimSpace(query)
|
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.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
|
// Has a space and follows regex, OR
|
||||||
// doesn't start with "//", contain "://", and doesn't have a dot either.
|
// doesn't start with "//", contain "://", and doesn't have a dot either.
|
||||||
// Then it's a search
|
// Then it's a search
|
||||||
|
Loading…
Reference in New Issue
Block a user