triaquae/jquery-datatables-column-filter

Number Range Filter incorrectly filtering results when 0 is entered as upper/lower bound

GoogleCodeExporter opened this issue · 1 comments

What steps will reproduce the problem?
1. Enter 0 in a From or To number range filter box
2. Enter any number in the remaining number rage filter box

What is the expected output? What do you see instead?
Expected output is for result set of data to be between upper and lower bound, 
for example:
from -5 to 0 
or 
from 0 to 10. 

I see instead
Input: from -5 to 0
output: -5 to infinity

input: from 0 to 10
output: -infinity to 10

What version of the product are you using? On what operating system?
DataTables 1.9.4, Column Filter 1.5.2, Windows 7

Please provide any additional information below.
Inputting 0.1 or -0.1 appears to work, but 0 does not restrict the result set.

Original issue reported on code.google.com by MasterMa...@gmail.com on 17 Jan 2014 at 6:44

That's link to your php code. Change the way you check values. 
Try something like this :
!is_numeric($columnFilterRangeMatches[0]) 

instead of :
empty($columnFilterRangeMatches[0])

Check if secure before, at least you know where to search

Original comment by adrien.f...@gmail.com on 30 Jan 2014 at 5:05