|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesMake-enveloppe-body-binary-safe (last revision 2012-06-18 15:50 UTC by jpauli@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-06-18 15:50 UTC] jpauli@php.net
[2012-06-18 23:06 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: jpauli
[2012-06-19 10:13 UTC] jpauli@php.net
[2012-06-19 19:24 UTC] pdezwart@php.net
[2012-06-19 19:24 UTC] pdezwart@php.net
-Status: Assigned
+Status: Closed
[2012-06-19 19:24 UTC] pdezwart@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 18:00:01 2025 UTC |
Description: ------------ AMQPEnveloppe#body is not binary safe, so it cant contain NULL byte, which is embarrassing when you deal with PHP serialization format which may contain NULL bytes aka : a serialized object Test script: --------------- <?php class Foo { private $bar="bar"; } $c = new AMQPConnection(/* params */); $c->connect(); $channel = new AMQPChannel($c); $ex = new AMQPExchange($channel); $ex->setName('test'); $ex->publish(serialize(new Foo), 'test'); $q = new AMQPQueue($channel); $q->setName('test'); var_dump($q->get()); Expected result: ---------------- string(39) "O:3:"Foo":1:{s:8:"Foobar";s:3:"bar";}" Actual result: -------------- The result gets truncated at the first NULL byte met, thus the unserialize() will fail. string(18) "O:3:"Foo":1:{s:8:""