Opened 17 years ago
Closed 16 years ago
#3801 closed patch (wontfix)
Don't search for empty strings in mythweb
Reported by: | Owned by: | Rob Smith | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythweb | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
This is a simple one liner patch for mythweb. It changes the search logic so it doesn't do a search if someone submits an empty search string. Someone on IRC mentioned that PHP appears to run out of memory when doing this.
Attachments (1)
Change History (7)
Changed 17 years ago by
Attachment: | mythweb_search.patch added |
---|
comment:1 Changed 17 years ago by
comment:2 Changed 16 years ago by
Owner: | changed from xris to Rob Smith |
---|---|
Status: | new → assigned |
comment:3 Changed 16 years ago by
I'm not sure if this is the best fix. There are times when I want all the results (Movies of 2 to 5 stars). How do you suggest we search for that?
comment:4 Changed 16 years ago by
Looking at it again, it's a bad fix, as it breaks the advanced search entirely. $_SESSIONsearch?s? only appears to be set for a quick search, we would need to test for $_SESSIONsearch?as? to catch the advanced searches.
FWIW though, shouldn't you be able to search for everything by using % instead of an empty string? It's not particularly pretty but it should work.
hads
comment:5 Changed 16 years ago by
It's true, but considering as a normal user, I doubt they would know to use %.
We could put text there somewhere, but I'd prefer to keep current usage.
I'll see if I can reduce the memory foot-print...
comment:6 Changed 16 years ago by
Resolution: | → wontfix |
---|---|
Status: | accepted → closed |
One issue with the patch is that the function 'empty()' in php returns true if the variable is set to 0 (either as an integer or a string). In practice this is probably inconsequential but I thought I would mention it.