Summary: Widget validate modifier gives negative false on '0'
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: Widgets

When testing the string '0' for validity as 'int', the modifier returns the
empty string.

This is because the conditional test for simple equality to TRUE:

modifier.validate.php (Feb 10 2009) :
if (array_key_exists($type, $filters) && filter_var($string, $filters[$type]))

Since filter_var returns the filtered data, in this case 0, this test is FALSE.
Instead this line should be like this:

if (array_key_exists($type, $filters) && filter_var($string, $filters[$type])
!== FALSE)

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Wikibugs-l mailing list

Reply via email to