UnionOfRAD/lithium — pull request #428 by toomuchpete (2012-04-13 15:32:47+00:00)
Title: Empty option inlist fix

This pull request fixes Issue #427

Because empty strings are used to signify lack of user response on forms, it causes problems when empty string evaluates as equivalent to the integer 0, because that means an inList validation against array(0,1,2) would return valid even when no value is entered, making it impossible to require that field.

This code casts values to strings so that empty strings do not match integers.

Note: I considered use of in_array()'s strict flag, but ruled it out because forms always produce strings, meaning that a form submission could never validate against array(0,1,2) because '0' !== 0.