convert numeric characters to int when unserializing json

This commit is contained in:
Nicolas Le Goff
2012-01-20 12:34:14 +01:00
parent f28d7d3a75
commit ec7b3837ca

View File

@@ -451,7 +451,17 @@ class searchEngine_options implements Serializable
$value = new DateTime($value);
}
elseif ($value instanceof stdClass)
$value = (array) $value;
{
$tmpvalue = (array) $value;
$value = array();
foreach($tmpvalue as $k=>$data)
{
$k = ctype_digit($k) ? (int) $k : $k;
$value[$k] = $data;
}
}
$this->$key = $value;
}