Skip Menu |

This queue is for tickets about the PHP-Session CPAN distribution.

Report information
The Basics
Id: 3917
Status: resolved
Worked: 5 min
Priority: 0/
Queue: PHP-Session

People
Owner: Nobody in particular
Requestors: Jason [...] fongboy.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.20
Fixed in: (no value)



Subject: Serializer truncates leading zeros in a string of numbers
The serializer seems to be truncating leading zeros from a string of numbers. It's treating the string of numbers as a regular number, so the leading zeros are dropped. But I need the zeros because it's part of a user id number. Here's how you could reproduce the problem: 1. In a PHP script, store a value such as 000123456 into the session 2. In Perl, use PHP::Session to open the session and add some other variable to it (I'm not sure, but I think you need to modify the session in order to have it write it back out to the filesystem); then save the session 3. now when you reload the session, the 000123456 value will be 123456 I've attached a patch to fix this. It's just a simple fix so that the is_int and is_float functions don't accept numbers with leading zeros. But they will still accept numbers like 0 or 0.xxxxx
Download patch
application/octet-stream 321b

Message body not shown because it is not plain text.

Thanks, fixed in 0.21 [guest - Tue Sep 30 19:08:01 2003]: Show quoted text
> The serializer seems to be truncating leading zeros from a string of > numbers. It's treating the string of numbers as a regular number, > so the leading zeros are dropped. But I need the zeros because > it's part of a user id number. > > Here's how you could reproduce the problem: > > 1. In a PHP script, store a value such as 000123456 into the session > 2. In Perl, use PHP::Session to open the session and add some other > variable to it (I'm not sure, but I think you need to modify the > session in order to have it write it back out to the filesystem); > then save the session > 3. now when you reload the session, the 000123456 value will be 123456 > > > I've attached a patch to fix this. It's just a simple fix so that the > is_int and is_float functions don't accept numbers with leading > zeros. But they will still accept numbers like 0 or 0.xxxxx