The recent security fix is NOT correct;

http://cgit.drupalcode.org/session_cache/commit/?id=14adaa31041b1a3b5221...

$data = ['test' => 'this', 'and' => 'that'];

$serialize = serialize($data);
$json = json_encode($data);

dpm(unserialize($serialize));
dpm(json_decode($json));

The two methods return data in different breaking ways, one is an array, the other an object. This functionality breaks anywhere that calls/ utilises the module for a session_cache_get() call.

Discovered while testing for: https://www.drupal.org/node/2901021

Comments

pobster created an issue. See original summary.

pobster’s picture

Simplest solution is to cast to an array, this maintains the previous expectation of functionality.

Okay ... there's an option which can be passed into json_decode ~ we'll use that instead. Thank you WidgetsBurritos!

pobster’s picture

Issue summary: View changes
pobster’s picture

Added child issue, I'm sure there must be others as well. Off the top of my head I know about: https://www.drupal.org/project/smart_ip

WidgetsBurritos’s picture

Status: Needs review » Reviewed & tested by the community

+1

pobster’s picture

StatusFileSize
new1.73 KB

Updated patch.

WidgetsBurritos’s picture

+1 on the updated patch. More elegant solution than typecasting.

  • RdeBoer committed 5dd675a on 7.x-1.x authored by pobster
    Issue #2901020 by pobster: Object/ array error with latest stable...

RdeBoer credited RdeBoer.

rdeboer’s picture

@pobster and @WidgetsBurritos:
Thanks for the patch. Applied with attribution.
Created 7.x-1.6 to replace 7.x-1.5

ciss’s picture

Is there a reason why this commit deleted the README.txt?

rdeboer’s picture

@ciss:

You are right.
?? How did that happen ??
Thanks for reporting.
I've put the README back and created version 7.x-1.7

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.