[wp-trac] [WordPress Trac] #45895: maybe_unserialize: handle exceptions thrown during unserialization

WordPress Trac noreply at wordpress.org
Mon Mar 11 20:48:48 UTC 2019


#45895: maybe_unserialize: handle exceptions thrown during unserialization
-------------------------------------------------+-------------------------
 Reporter:  bluefuton                            |       Owner:  desrosj
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  5.2
Component:  General                              |     Version:  5.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests reporter-   |     Focuses:
  feedback                                       |
-------------------------------------------------+-------------------------
Changes (by desrosj):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests reporter-
     feedback


Comment:

 @bluefuton I started digging into this a bit deeper, but I have been
 unable to trigger an exception with your example input. Also,
 [attachment:"maybe_unserialize_handle_exception.patch"] is [https
 ://travis-ci.org/desrosj/wordpress-develop/jobs/504838115 causing failures
 elsewhere] in the test suite.

 I have tested with PHP versions all the way back to 5.6. Each version
 returns a `false` boolean when passing your test input value to
 `unserialize()`.

 If I remove error suppression (`@`), I see the following error in PHP <
 7.3, but I still get a `false` boolean:

 > Warning:  Erroneous data format for unserializing 'SimpleXMLElement' in
 /path/to/file
 > Notice:  unserialize(): Error at offset 27 of 28 bytes in /path/to/file

 Can you provide some more information to help me see what I am missing?

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


More information about the wp-trac mailing list