Skip to content

Conversation

duncan3dc
Copy link
Member

I wrote the included test for Bug 73529, and I attempted to fix it but couldn't quite figure it out.

I think the problem is around this part of the code. It reads like if it doesn't find the delimiter (separating the name from the value, eg test|i:1;) then it just returns true. But we can't set a failure here, as an empty session would also fail.

Any suggestions @yohgaki, or am I way off?

@php-pulls
Copy link

Comment on behalf of krakjoe at php.net:

labelling

@yohgaki
Copy link
Contributor

yohgaki commented Nov 27, 2016

@duncan3dc Thank you. I'll look into this.

BTW "php" serializer uses special serialization format because of "register_globals" legacy. If you would like to use plain "serialize()", you need "php_serialize" as session serializer. Regardless of this, failed decode should be handled properly.

@php-pulls php-pulls merged commit 2d81675 into php:master Nov 27, 2016
@cmb69
Copy link
Member

cmb69 commented Aug 3, 2018

@duncan3dc I think you're spot on! If the delimiter is not found, we can set failure there, because for an empty session the outer while loop would not be executed. The only issue I could see is for manually constructed session strings, which may have trailing whitespace (or even other characters), so we may have a BC break here. Might be best to apply a respective fix for master or PHP-7.3 only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants