BoldGrid / weforms

7 stars 12 forks source link

PHP 8.2 Deprecated notice #202

Closed jamesros161 closed 1 year ago

jamesros161 commented 1 year ago

The following notice is generated when running PHP 8.2. PHP Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

This was backtraced to weforms/includes/fields/class-abstract-fields.php(446) : <label for="<?php echo isset( $field['name'] ) ? esc_attr( $field['name'] ) . '_' . esc_attr( $form_id ) : 'cls'; ?>"><?php echo esc_html( $field['label'] ) . wp_kses_post( $this->required_mark( $field ) ) ; ?></label>

The issue is that the method required_mark() is returning null instead of an empty string.

This can be resolved with PR #203