|
@@ -39,7 +39,7 @@ class FormatV2
|
|
|
$required_keys[] = 'meta';
|
|
$required_keys[] = 'meta';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Make sure no additionnal keys were added.
|
|
|
|
|
|
|
+ // Make sure no additional keys were added.
|
|
|
if (count(array_keys($message)) !== count($required_keys)) {
|
|
if (count(array_keys($message)) !== count($required_keys)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -63,6 +63,11 @@ class FormatV2
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Make sure the adata parameters of pastes are a properly sized array,
|
|
|
|
|
+ if (!$isComment && count($message['adata']) !== 4) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Make sure the ciphertext and the cipher parameters used in the
|
|
// Make sure the ciphertext and the cipher parameters used in the
|
|
|
// string operations below are actually strings, so that malformed
|
|
// string operations below are actually strings, so that malformed
|
|
|
// input yields "Invalid data." instead of a fatal type error.
|
|
// input yields "Invalid data." instead of a fatal type error.
|