Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion classes/helpers/FrmEntriesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ private static function get_field_value_for_new_entry( $field, $reset, $args ) {
self::get_posted_value( $field, $new_value, $args );
}

// A field with no default value has a null default_value, and a field type
// whose value is not posted back leaves it null too. str_replace() warns on
// a null subject in PHP 8.1+, so cast first: this keeps returning the empty
// string the caller already relied on.
if ( ! is_array( $new_value ) ) {
return str_replace( '"', '"', $new_value );
return str_replace( '"', '"', (string) $new_value );
}

return $new_value;
Expand Down