interwho / cReddit-Bot

The Reddit Bot used on r/loans

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search queries don't work if the username contains a hyphen

shrink opened this issue · comments

commented

The reddit search engine uses hyphens as a modifier, if a username contains a hyphen things go funky.

For example:

http://www.reddit.com/r/Loans/search?q=title%3A-Master-Builder-+%5BPAID%5D&restrict_sr=on&sort=new

This can be fixed by enclosing the search query with quotation marks:

http://www.reddit.com/r/Loans/search?q='title%3A-Master-Builder-+%5BPAID%5D'&restrict_sr=on&sort=new

Another example:

http://www.reddit.com/r/Loans/search?q=title%3A-otahak-+%5BPAID%5D&restrict_sr=on&sort=new

http://www.reddit.com/r/Loans/search?q=title%3A%27-otahak-+%5BPAID%5D%27&restrict_sr=on&sort=new&t=all

Looks like that will resolve the problem. I'll submit a pull request with this fixed in a few hours, just making a note here so that it doesn't get forgotten.

Has this been fixed? It looks like it hasn't. Want me to take a stab at it?