Skip to content
Snippets Groups Projects
Commit e39a326f authored by Jacob Rockowitz's avatar Jacob Rockowitz Committed by Jacob Rockowitz
Browse files

Issue #3328986 by jrockowitz: Files cannot be attached to the form

parent 2e20f671
Branches
Tags
No related merge requests found
...@@ -494,7 +494,22 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn ...@@ -494,7 +494,22 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn
if (isset($this->dataHash)) { if (isset($this->dataHash)) {
return $this->dataHash; return $this->dataHash;
} }
$this->dataHash = Crypt::hmacBase64(serialize($this->getRawData()), Settings::getHashSalt());
// Anonymous recursive data massaging function.
$massage_data = function (array $array) use (&$massage_data) {
foreach ($array as $key => $value) {
if (is_object($value)) {
unset($array[$key]);
}
elseif (is_array($value)) {
$array[$key] = $massage_data($value);
}
}
return $array;
};
$data = $massage_data($this->getRawData());
$this->dataHash = Crypt::hmacBase64(serialize($data), Settings::getHashSalt());
return $this->dataHash; return $this->dataHash;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment