From: Martin Sarsale <martin.sarsale@gm...> - 2004-09-09 17:57:04
I've found 2 bugs related to sort_mode:
There're a lot of checks that set a default sort_mode if the user has
not especified a specific order. The problem is when the user sents an
empty or invalid sort_mode.
The first case is easy to catch by setting the default sort_mode if
the user has not specified it (he didn't send the sort_mode param or
sent an empty value)
The second case (invalid sort_mode) is much difficult to detect since
you can't know which columns exist on the table without querying the
database (and querying the db for the table structure is not an
option). I thought that we could modify the function
"convert_sortmode" and add 2 optional parameters: the list of the
allowed sort modes a default one.
Then, if convert_sortmode receives an empty sort_mode or an invalid,
it will return the default one.
What do you think?
Martin Sarsale - martin@...