Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81929 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97192 invoked from network); 5 Feb 2015 14:07:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 14:07:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=jrbasso@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jrbasso@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.176 as permitted sender) X-PHP-List-Original-Sender: jrbasso@gmail.com X-Host-Fingerprint: 209.85.213.176 mail-ig0-f176.google.com Received: from [209.85.213.176] ([209.85.213.176:56109] helo=mail-ig0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/0E-27691-72973D45 for ; Thu, 05 Feb 2015 09:07:36 -0500 Received: by mail-ig0-f176.google.com with SMTP id hl2so42911867igb.3 for ; Thu, 05 Feb 2015 06:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=YZGTF9zh6gQPBPvbbIqaJKDq2FN8aJoWEmUBI5NruzE=; b=uSl0nIPysIkuYI5u3NY9JJ55zJsQiAmZtqfMuSrTdtqfMleL7KrkgRTxgtyfOMofl7 ZbiRtFrYvOAt8WhIh+ajx32nFGuQ9oG95udSX4k593NugST6kspyuheMpsupyL3hka4S uyAY63dd9D6lSPGwQ+06b9I2UnTEl4IH04v7MmNe7SWW0/SPukiFWkSvnDXTphyhF08D KkftysJmVw1f9Rm8Ct+7PtbLfNqihB0AweOUPGGRwDzXvauD0G9TemzSptpZQF32PRdV 3h1NB76i2SY/ZstkWkdZ2i5HGHh/hWX7Ob2DaRpqSFJLjg9m3zl/BeYV0QLF9u1ykyim kJoQ== MIME-Version: 1.0 X-Received: by 10.107.41.212 with SMTP id p203mr4552605iop.54.1423145253352; Thu, 05 Feb 2015 06:07:33 -0800 (PST) Received: by 10.64.25.114 with HTTP; Thu, 5 Feb 2015 06:07:33 -0800 (PST) In-Reply-To: References: Date: Thu, 5 Feb 2015 09:07:33 -0500 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=001a1141f1864a3bed050e57d38c Subject: Re: Serialize generating corrupted data From: jrbasso@gmail.com (Juan Basso) --001a1141f1864a3bed050e57d38c Content-Type: text/plain; charset=UTF-8 No one? On Mon, Feb 2, 2015 at 8:57 PM, Juan Basso wrote: > Hi, > > I was testing few things today and I released one bug in the serialize > function. The serialize function returns a corrupted value when it is > serializing an object that contains a __sleep magic method and this method > return some key that are not string. Ie: > > http://viper-7.com/EK16EV > > If the __sleep returns a string that is not a property it is fine, it will > give the notice and the generated response is a valid serialized data (in > another words you can use unserialize to retrieve the object back). Ie, > http://viper-7.com/H9ooff > > I can try to make a patch to solve it, but before that I would like how > the behavior should be. Some options: > 1) Give the notice saying the field doesn't exist and do not include on > the serialized response > 2) Give the notice saying the field doesn't exist and convert the value to > string (ie, on my example the int(1) would be transformed to string(1)) > 3) Give a warning and return false once the input from __sleep is invalid > 4) None of the above alternative > 5) Don't change it > > > Thanks, > Juan Basso > --001a1141f1864a3bed050e57d38c--