You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is a regression from the 2.8.2 package version (this bug is not present in the 2.8.0)
When i populate the BrowserInfo with these values (i masked the ipaddr) :
{
"ipaddr": "xxx.xxx.xxx.xxx",
"http_accept": "application\/json, text\/plain, *\/*",
"http_user_agent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/90.0.4430.93 Safari\/537.36",
"java_enabled": false,
"javascript_enabled": true,
"language": "fr-FR",
"color_depth": 24,
"screen_height": 1440,
"screen_width": 3440,
"timezone": "-120"
}
The serialization process before the request remove the "java_enabled" and "javascript_enabled" properties :
{"ipaddr":"172.18.0.1","httpAccept":"application\/json, text\/plain, *\/*","httpUserAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/90.0.4430.93 Safari\/537.36","language":"fr-FR","colorDepth":24,"screenHeight":1440,"screenWidth":3440,"timezone":"-120"}
The main bug is inside the AbstractModel serialization function "toArray" :
foreach ($classRef->getMethods() as $method) {
if (substr($method->name, 0, 3) == 'get') {
//clean key name
$key = lcfirst(substr($method->name, 3));
//Call getter to get the value
$val = $method->invoke($this);
if (is_object($val) && is_a($val, AbstractModel::class)) {
$array[$key] = $val->toArray();
} elseif ($val !== null) {
$array[$key] = $val;
}
}
}
The 2 properties for java_enabled et javascript_enabled are name with "isJavascriptEnabled" and "isJavaEnabled", so the result of these 2 functions are not parsed... and the requestOrder failed with DSP2...
So the fix must be :
change the isJavaEnabled & isJavascriptEnabled to getJavaEnabled & getJavascriptEnabled
or do a in_array with ['get','is'] for the substr
The text was updated successfully, but these errors were encountered:
Hi,
this is a regression from the 2.8.2 package version (this bug is not present in the 2.8.0)
When i populate the BrowserInfo with these values (i masked the ipaddr) :
The serialization process before the request remove the "java_enabled" and "javascript_enabled" properties :
The main bug is inside the AbstractModel serialization function "toArray" :
The 2 properties for java_enabled et javascript_enabled are name with "isJavascriptEnabled" and "isJavaEnabled", so the result of these 2 functions are not parsed... and the requestOrder failed with DSP2...
So the fix must be :
The text was updated successfully, but these errors were encountered: