Opened 15 years ago
Closed 12 years ago
#16472 closed defect (bug) (maybelater)
set_query_var() / get_query_var() does not work for NULL values
| Reported by: | hakre | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | |
| Severity: | normal | Keywords: | has-patch needs-unit-tests |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I have gotten bitten by this (
null+isset()) a few times recently