https://bugzilla.wikimedia.org/show_bug.cgi?id=25219

           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
        AssignedTo: sergey.chernys...@gmail.com
        ReportedBy: armea...@gmail.com
                CC: wikibugs-l@lists.wikimedia.org


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: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to