Opened 7 years ago
Last modified 7 years ago
#46923 new defect (bug)
$wpdb->get_var() — empty sting becomes a NULL
| Reported by: | Tkama | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Database | Version: | 5.1.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description (last modified by )
Because of the following condition, we get NULL, even if a real field value is an empty string!
<?php return ( isset( $values[ $x ] ) && $values[ $x ] !== '' ) ? $values[ $x ] : null;
I think it is better to delete $values[ $x ] !== '' check and return field value as it is if it exists - what is usually meant by NULL in PHP (empty string is not null!).
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)