Skip to content

URL encode search queries containing at least '#' #3

@richterdavid

Description

@richterdavid

Searching for '#example' fails today as the search query is after a # in the URL and so is not even transmitted to the server. You can search for 'example'.

Eg, '#example' with 'Google (more accurate)' yields the URL:
https://www.google.com/webhp#example+(intext%3A%22modlog%22+%26+%22instances%22+%26+%22docs%22+%26+%22code%22+%26+%22join-lemmy%22+%7C+intext%3A%22powered+by+mbin%22+%7C+intext%3A%22part+of+the+decentralized+social+network+powered+by+mastodon%22+%7C+intext%3A%22powered+by+peertube%22)

Removing the '#' from the query yields:
https://www.google.com/search?q=example+(intext%3A%22modlog%22+%26+%22instances%22+%26+%22docs%22+%26+%22code%22+%26+%22join-lemmy%22+%7C+intext%3A%22powered+by+mbin%22+%7C+intext%3A%22part+of+the+decentralized+social+network+powered+by+mastodon%22+%7C+intext%3A%22powered+by+peertube%22)

Indeed, the url
https://www.google.com/search?q=#testing
Is redirected to
https://www.google.com/webhp#testing

Similar problems may occur with search queries containing other characters that are disallowed in urls or have special meanings in them, so I would recommend url-encoding all of them.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions