[wp-trac] [WordPress Trac] #34703: wp_db->strip_invalid_text problem with NULL varchar(2) fields

WordPress Trac noreply at wordpress.org
Sat Jan 9 04:46:52 UTC 2016


#34703: wp_db->strip_invalid_text problem with NULL varchar(2) fields
-------------------------------+----------------------
 Reporter:  TiagoGouvea        |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Database           |     Version:  4.2.4
 Severity:  normal             |  Resolution:  invalid
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+----------------------
Changes (by dd32):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Discussion happened in another ticket -
 https://core.trac.wordpress.org/ticket/34482#comment:6

 @TiagoGouvea was passing a string to `$wpdb->update()` and then was
 filtering the query later to force `'NULL'` to `NULL`.

 @TiagoGouvea That's just not supported, and won't be in any way. In
 WordPress 4.4+ passing a literal `NULL` does work. If you need to support
 older versions, don't use `$wpdb->update()` and instead do `$wpdb->update(
 "UPDATE .. SET field = NULL" );`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34703#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list