Opened 17 years ago

Closed 16 years ago

#3801 closed patch (wontfix)

Don't search for empty strings in mythweb

Reported by: Hadley Rich <hads@…> 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)

mythweb_search.patch (413 bytes) - added by Hadley Rich <hads@…> 17 years ago.

Download all attachments as: .zip

Change History (7)

Changed 17 years ago by Hadley Rich <hads@…>

Attachment: mythweb_search.patch added

comment:1 Changed 17 years ago by Jeff <jeff@…>

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.

comment:2 Changed 16 years ago by Rob Smith

Owner: changed from xris to Rob Smith
Status: newassigned

comment:3 Changed 16 years ago by Rob Smith

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 Hadley Rich <hads@…>

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 Rob Smith

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 Rob Smith

Resolution: wontfix
Status: acceptedclosed
Note: See TracTickets for help on using tickets.