Last modified: 2010-09-19 23:33:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T27219, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25219 - Widget validate modifier gives negative false on '0'
Widget validate modifier gives negative false on '0'
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Widgets (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Sergey Chernyshev
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-19 21:45 UTC by ArmEagle
Modified: 2010-09-19 23:33 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description ArmEagle 2010-09-19 21:45:20 UTC
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)
Comment 1 ArmEagle 2010-09-19 22:09:32 UTC
I just want to add that this is with the Widgets extension version 0.9f.
Comment 2 Sergey Chernyshev 2010-09-19 23:28:53 UTC
Yep, seems reasonable. Fixed in r73350. Please test and let me know if that helped.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links