Jump to content

Unserialize() (error?) forces download dialog instead of regular pageload


kael.shipman

Recommended Posts

Hey everyone,

 

I've got an undo framework that I built to handle edits on a site. I can't post a URL cause it's a private site. The framework is centered around two objects, "Command" and "Action". Within a given Command, there is an array of Actions. That should be sufficient information for this discussion, but if you need more detail, I'll gladly provide.

 

What's happening is that I create a new Command, add a bunch of Actions to it, then serialize it and store it in the database for the next pageload, where I add more Actions to the same Command and then finally execute the Command. I escape it properly when inserting into the database, then when I retrieve it, I unescape it (both with a SmartSlashes function that's a little more robust than the standard) and then unserialize it.

 

The problem is that when I hit the submit button to move to the next page, instead of loading the next page, a download dialog pops up wanting me to download index.php. I tried doing that once just to see what would happen and it was just a blank file. I traced the cause of the download dialog to the use of unserialize, but can't figure out where my error is. The serialized string is 55,000 characters, so I can't really go through and find out where the problem is, either. I tried unserializing a smaller object string and it worked fine. Does anyone have any ideas on what might possibly be causing unserialize to change the output to a downloadable file or how to get it to stop doing that?

 

Thanks for anything you can offer.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.