[wp-trac] [WordPress Trac] #50678: Transient: save object with protected attributes will fail

WordPress Trac noreply at wordpress.org
Thu Jul 16 11:16:22 UTC 2020


#50678: Transient: save object with protected attributes will fail
--------------------------------+-----------------------------
 Reporter:  mxlq                |      Owner:  (none)
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  5.3
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 When I save a custom object with protected attributes no value is set into
 database.

 I think it's because php's serialize function use null bytes (\0) when
 serializing protected properties. MySql does not complain so function
 returns true like everthing is normal.

 See this stack overflow [https://stackoverflow.com/questions/62915246
 /wordpress-save-object-with-protected-attributes-to-transient-will-fail
 post].

 I'm using:
 - WordPress 5.3.4
 - MySql Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64)
 using readline 5.2.
 - PHP Version 7.3.19-1~deb10u1

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50678>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list