6.0.0-beta1
7/14/25

[#13275] Horde_Pack corrupts non-UTF8 strings
Summary Horde_Pack corrupts non-UTF8 strings
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester thomas.jarosch (at) intra2net (dot) com
Created 06/20/2014 (4042 days ago)
Due
Updated 06/27/2014 (4035 days ago)
Assigned
Resolved 06/25/2014 (4037 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/27/2014 04:56:04 AM Michael Slusarz Comment #5 Reply to this comment
Horde_Pack 1.0.2.
Thanks, looking good. The "5" error code is evil :D though there is 
no better way right now.
True... but probably should add a todo in there for the future.

06/26/2014 01:45:58 PM Thomas Jarosch Comment #4 Reply to this comment
Horde_Pack 1.0.2.
Thanks, looking good. The "5" error code is evil :D though there is no 
better way right now.

06/25/2014 06:40:53 PM Michael Slusarz Comment #3
Assigned to Michael Slusarz
State ⇒ Resolved
Reply to this comment
Horde_Pack 1.0.2.
06/25/2014 06:40:14 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit d33b22bfa2408692c775c31437c5ea5e554941da
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Wed Jun 25 12:38:00 2014 -0600

     [mms] Don't use JSON driver to pack if input contains non-UTF8 
data (Bug #13275).

  framework/Pack/lib/Horde/Pack.php             |    6 +++++-
  framework/Pack/lib/Horde/Pack/Driver/Json.php |    7 ++++++-
  framework/Pack/package.xml                    |    4 ++--
  framework/Pack/test/Horde/Pack/PackTest.php   |   21 +++++++++++++++++++++
  4 files changed, 34 insertions(+), 4 deletions(-)

http://github.com/horde/horde/commit/d33b22bfa2408692c775c31437c5ea5e554941da
06/20/2014 12:18:52 PM Thomas Jarosch Comment #1
Priority ⇒ 1. Low
New Attachment: test_horde_pack.php Download
Patch ⇒ No
Milestone ⇒
Summary ⇒ Horde_Pack corrupts non-UTF8 strings
Type ⇒ Bug
State ⇒ Unconfirmed
Queue ⇒ Horde Framework Packages
Reply to this comment
Hi,

while still trying to track down #13274, I noticed a json_encode() 
error message in the backtrace.

Basically Horde_Pack defaults to JSON encoding using json_encode() on my box.
json_encode() accepts valid UTF-8 strings only, otherwise it corrupts 
the data.

Please see the attached test script to show the data corruption.

A "workaround" is to remove the "Json.php" Pack driver from "Pack/Driver",
so it will default to Serialize.php then.

Cheers,
Thomas

Saved Queries