Skip to content

Commit

Permalink
Merge pull request #2490 from kprajapatii/master
Browse files Browse the repository at this point in the history
prevent PHP notice on empty extra fields option
  • Loading branch information
kprajapatii authored Dec 6, 2023
2 parents bc16f0a + 90904b8 commit e8a8e32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ public static function file_types( $output, $result_str, $cf, $field_info ) {
$extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
$gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? maybe_unserialize($extra_fields['gd_file_types']) : array('*');
if ( ! empty( $gd_file_types ) ) {
if ( is_scalar( $gd_file_types ) ) {
$gd_file_types = explode( ",", $gd_file_types );
}

$gd_file_types = array_filter( $gd_file_types );
}

Expand Down
2 changes: 1 addition & 1 deletion includes/custom-fields/input-functions-aui.php
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ function geodir_cfi_address( $html, $cf ) {
$required_msg = $cf['required_msg'];
$frontend_title = $cf['frontend_title'];
$is_admin = $cf['for_admin_use'];
$extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields']));
$extra_fields = ! empty( $cf['extra_fields'] ) ? stripslashes_deep( maybe_unserialize( $cf['extra_fields'] ) ) : array();
$prefix = $name . '_';
$street2_title = '';

Expand Down

0 comments on commit e8a8e32

Please sign in to comment.