Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions includes/classes/class-add-listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function atbdp_submit_listing() {
'post_content' => $content,
'post_title' => $title,
'post_type' => ATBDP_POST_TYPE,
'tax_input' => ! empty( $info['tax_input'] ) ? atbdp_sanitize_array( $info['tax_input'] ) : array(),
'tax_input' => ! empty( $info['tax_input'] ) ? directorist_clean( $info['tax_input'] ) : array(),
'meta_input' => apply_filters( 'atbdp_ultimate_listing_meta_user_submission', $metas, $info ),
);
// is it update post ? @todo; change listing_id to atbdp_listing_id later for consistency with rewrite tags
Expand Down Expand Up @@ -576,7 +576,7 @@ public function atbdp_submit_listing() {
$listing_images = atbdp_get_listing_attachment_ids( $post_id );
$files = ! empty( $_FILES['listing_img'] ) ? directorist_clean( wp_unslash( $_FILES['listing_img'] ) ) : array();
$files_meta = ! empty( $_POST['files_meta'] ) ? directorist_clean( wp_unslash( $_POST['files_meta'] ) ) : array();

if ( ! empty( $listing_images ) ) {
foreach ( $listing_images as $__old_id ) {
$match_found = false;
Expand Down
4 changes: 1 addition & 3 deletions includes/classes/class-ajax-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,9 @@ public function ajax_callback_custom_fields() {
}

$listing_type = ! empty( $_POST['directory_type'] ) ? sanitize_text_field( wp_unslash( $_POST['directory_type'] ) ) : '';
$categories = ! empty( $_POST['term_id'] ) ? atbdp_sanitize_array( wp_unslash( $_POST['term_id'] ) ) : array();
$categories = ! empty( $_POST['term_id'] ) ? directorist_clean( wp_unslash( $_POST['term_id'] ) ) : array();
$post_id = ! empty( $_POST['post_id'] ) ? sanitize_text_field( wp_unslash( $_POST['post_id'] ) ) : '';
$listing_type = ! empty( $_POST['directory_type'] ) ? sanitize_text_field( wp_unslash( $_POST['directory_type'] ) ) : '';
$categories = ! empty( $_POST['term_id'] ) ? atbdp_sanitize_array( wp_unslash( $_POST['term_id'] ) ) : array();
$post_id = ! empty( $_POST['post_id'] ) ? absint( wp_unslash( $_POST['post_id'] ) ) : '';
// wp_send_json($post_id);
$template = '';
$submission_form_fields = array();
Expand Down
17 changes: 4 additions & 13 deletions includes/helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5738,22 +5738,13 @@ function atbdp_get_term_icon( array $args = [] )
if (!function_exists('atbdp_sanitize_array')) {
/**
* It sanitize a multi-dimensional array
*
* @deprecated 7.3.1
* @param array &$array The array of the data to sanitize
* @return mixed
*/
function atbdp_sanitize_array(&$array)
{

foreach ($array as &$value) {
if (!is_array($value)) {
// sanitize if value is not an array
$value = sanitize_text_field($value);
} else {
// go inside this function again
atbdp_sanitize_array($value);
}
}
return $array;
function atbdp_sanitize_array( $array ) {
return directorist_clean( $array );
}
}

Expand Down