Skip to content

Commit d837bdd

Browse files
committed
fix: transforms the field name to lowercase #16
When using content()->toArray() the keys are transformed to lowercase, when a user set the field names in camelcase uppercase they won’t be found in the array. This fix solves that issue
1 parent 9c0c7aa commit d837bdd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ExternalPostSender.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ public function getTextFieldContent($page, $trimTextPosition)
4848

4949
if (is_array($this->textfields)) {
5050
foreach ($this->textfields as $field) {
51-
if (isset($content[$field]) && !empty($content[$field])) {
52-
return Str::short($content[$field], $trimTextPosition);
51+
$lowercaseField = strtolower($field);
52+
if (isset($content[$lowercaseField]) && !empty($content[$lowercaseField])) {
53+
return Str::short($content[$lowercaseField], $trimTextPosition);
5354
}
5455
}
5556
}

0 commit comments

Comments
 (0)