Giter Club home page Giter Club logo

Comments (2)

jeremeamia avatar jeremeamia commented on July 17, 2024

I believe you a running into an issue will null bytes. As explained in a note on the PHP manual entry for serialize():

Object's private members have the class name prepended to the member name; protected members have a '*' prepended to the member name. These prepended values have null bytes on either side.

SuperClosure has never done anything to prevent those null bytes from being included in the serialized string. For example, if you serialize a closure that has an object with private members as one of it's context variables, you would've hit the same problem with any version of SuperClosure. It's your responsibility to take the serialized data, and format it for the purpose of whatever you are doing with it. In your case, it sounds like doing a base64_encode() would be a good idea.

The latest beta of SuperClosure includes the Serializer object in the serialization, which does have private members, and would definitely output null bytes. That is why you are running into issues now. However, I've just made a change that removes the need to serialize the Serializer. With that commit, the symptom of your problem should disappear, but your actual problem still remains.

from super_closure.

storeman avatar storeman commented on July 17, 2024

That explains a lot. Thanks. I will definitely use base64 as this will prevent future issues in this area.

from super_closure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.