Skip to content

Commit

Permalink
Fix undefined for everyone
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 authored Jan 9, 2023
1 parent e923bd8 commit aa23b59
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions class.wph-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,18 @@ function update($new_instance, $old_instance) {
foreach ($this->fields as $key) {
$slug = $key['id'];

if (isset($key['validate'])) {
if (false === $this->validate($key['validate'], $new_instance[$slug])) {
return $instance;
if (isset($new_instance[$slug])) {
if (isset($key['validate'])) {
if (false === $this->validate($key['validate'], $new_instance[$slug])) {
return $instance;
}
}

$instance[$slug] = strip_tags($new_instance[$slug]);

if (isset($key['filter'])) {
$instance[$slug] = $this->filter($key['filter'], $new_instance[$slug]);
}
}

@$instance[$slug] = strip_tags($new_instance[$slug]);
if (isset($key['filter'])) {
$instance[$slug] = $this->filter($key['filter'], $new_instance[$slug]);
}
}

Expand Down

0 comments on commit aa23b59

Please sign in to comment.