Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix filters with date custom fields on PHP 8
In PHP < 8.0, comparing a string to 0 evaluates to true when the string is empty, but starting with 8.0 it returns false [1]. As a result, when BugFilterQuery::build_prop_custom_fields() checks the filter (`$t_field[0] == CUSTOM_FIELD_DATE_ANY`, line 1470), it fails on PHP 8.0+. To fix this behavior, we ensure that a date custom fields's filter type is always an int: - When processing it in filter_gpc_get(), use gpc_get_int() instead of gpc_get_string() to retrieve the filter's type - When validating a filter, add special handling for date custom fields to ensure that the values (control, timestamp 1 & 2) are treated as integers. Fixes #35291 [1]: https://wiki.php.net/rfc/string_to_number_comparison
- Loading branch information