Skip to content

Commit f4c9818

Browse files
committed
fix: make sure getValueFromNestedArray() returns string in PersonalDataService class
1 parent f55b119 commit f4c9818

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/PrefillGravityForms/Services/PersonalDataService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ private function key(string $key): string
6363
return $key;
6464
}
6565

66-
private function getValueFromNestedArray(string $keyString, array $array): string
66+
private function getValueFromNestedArray(string $keyString, array $data): string
6767
{
6868
$keys = explode('.', $keyString);
6969

7070
foreach ($keys as $key) {
71-
if (is_array($array) && isset($array[$key])) {
72-
$array = $array[$key];
71+
if (is_array($data) && isset($data[$key])) {
72+
$data = $data[$key];
7373
} else {
7474
return '';
7575
}
7676
}
7777

78-
return $array;
78+
return (string) $data;
7979
}
8080

8181
private function format(string $key, string $value): string

0 commit comments

Comments
 (0)