Details
Description
It appears that a suppressed warning when constructing a date from an existing date string inside a custom session savehandler causes Zend_Session to throw an exception.
Zend_Session_Exception: Zend_Session::start() - /ZendFramework-1.8.4PL1/library/Zend/Date/DateObject.php(Line:667): Error #2 getdate() expects parameter 1 to be long, string given Array in /ZendFramework-1.8.4PL1/library/Zend/Session.php on line 444
On line 179 of Zend_Date's constructor $this->getGmtOffset() is called which in turn calls $date = $this->getDateParts($this->getUnixTimestamp(), true);
$this->getUnixTimestamp() returns a string which is passed to getDateParts
The following warning is then suppressed on the call to return @getdate($timestamp);
Warning: getdate() expects parameter 1 to be long, string given in /ZendFramework-1.8.4PL1/library/Zend/Date/DateObject.php on line 667
The warning still causes Zend_Session to throw an exception (Due to its handling of errors).
This is a simplified version of my savehandler to reproduce the problem.
Class My_Session_SaveHandler_Memcached implements Zend_Session_SaveHandler_Interface
{
public function open($save_path, $name)
{
}
public function close()
{
}
public function read($id)
{ $date = new Zend_Date('2009-07-27 02:31:47', Zend_Date::ISO_8601); } public function write($id, $data)
{
return true;
}
public function destroy($id)
{
}
public function gc($maxLifetime)
{ return true; } }
}
Duplicate of
ZF-7188ZF-7188