[wp-trac] [WordPress Trac] #21109: maybe_unserialized fails to unserialize multibyte strings (contains solution)

WordPress Trac wp-trac at lists.automattic.com
Fri Jun 29 10:54:56 UTC 2012


#21109: maybe_unserialized fails to unserialize multibyte strings (contains
solution)
------------------------------------+------------------------------
 Reporter:  veedeezee               |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  General                 |     Version:  3.4
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------

Comment (by veedeezee):

 Hello, Sergey.

 This is exactly the case with the DB charset not matching the what is
 specified in wp_config.php, however please note the following:
 1. All Hebrew data is read and displayed perfectly by Wordpress
 2. The fix I'd applied leave Hebrew data perfectly readable

 Replying to [comment:2 SergeyBiryukov]:
 > Related: #6532, #6784, #9549
 >
 > To clarify, `preg_replace()` is used to fix string lengths. This exact
 fix was suggested in [comment:ticket:6532:8].
 >
 > I can only reproduce this if `DB_CHARSET` value in `wp-config.php`
 doesn't match the actual DB charset (e.g. `latin1` vs. `utf8_general_ci`),
 as mentioned in [comment:ticket:6784:3].
 >
 > With the fix, the strings are still unreadable due to charset
 differences, but at least it allows other data to be unserialized
 properly. Perhaps the strings would be readable under some circumstances,
 needs more investigating.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21109#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list