Skip to content

Commit

Permalink
Merge pull request #1249 from albionselimaj/fix/field-sanitizer-issue
Browse files Browse the repository at this point in the history
Fix issue with "sanitize_posted_field" method when an array of values is provided.
  • Loading branch information
jom authored Dec 1, 2017
2 parents 0a3f317 + f3c3f40 commit 0c07ef3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion includes/abstracts/abstract-wp-job-manager-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,13 @@ protected function get_posted_fields() {
protected function sanitize_posted_field( $value, $sanitizer = null ) {
// Sanitize value
if ( is_array( $value ) ) {
return array_map( array( $this, 'sanitize_posted_field' ), $value, $sanitizer );
foreach ($value as $key => $val) {
$value[ $key ] = $this->sanitize_posted_field( $val, $sanitizer );
}

return $value;
}

$value = trim( $value );

if ( 'url' === $sanitizer ) {
Expand Down

0 comments on commit 0c07ef3

Please sign in to comment.