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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.