Update of /cvsroot/phplib/php-lib-stable/php
In directory usw-pr-cvs1:/tmp/cvs-serv2140
Modified Files:
ct_shm.inc
Log Message:
bug ID 460338: string comparison of integer value
caused bogus session removal once every 30 years.
Index: ct_shm.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/ct_shm.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ct_shm.inc 12 Jul 2000 18:22:33 -0000 1.2
--- ct_shm.inc 10 Aug 2002 00:54:30 -0000 1.3
***************
*** 62,71 ****
function ac_gc($gc_time, $name) {
$cmp = time() - $gc_time * 60;
! for($i = 1; $i <= $this->max_sessions; $i++)
if(($val = @shm_get_var($this->shmid, $i)) != false) {
$dat = explode(";", $val);
! if($name == $dat[1] && strcmp($dat[3], $cmp) < 0)
shm_remove_var($this->shmid, $i);
}
}
--- 62,73 ----
function ac_gc($gc_time, $name) {
$cmp = time() - $gc_time * 60;
! for($i = 1; $i <= $this->max_sessions; $i++) {
if(($val = @shm_get_var($this->shmid, $i)) != false) {
$dat = explode(";", $val);
! if($name == $dat[1] && intval($dat[3]) < $cmp) {
shm_remove_var($this->shmid, $i);
+ }
}
+ }
}
|