Opened 14 years ago
Closed 11 years ago
#16472 closed defect (bug) (maybelater)
set_query_var() / get_query_var() does not work for NULL values
Reported by: | hakre | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Query | Keywords: | has-patch needs-unit-tests |
Focuses: | Cc: |
Description
Setting a query var to NULL will convert it into an empty string:
$name = 'test'; $value = NULL; set_query_var($name, $value); $get = get_query_var($name); echo $value === $get ? 'same' : 'different'; var_dump($get);
This will output "different" and showing that the query var now is an empty string.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
I have gotten bitten by this (
null
+isset()
) a few times recently