Skip to content

Commit

Permalink
Merge pull request #1307 from lkraav/1080-prevent-empty-meta
Browse files Browse the repository at this point in the history
Prevent inserting empty meta values, fix #1080
  • Loading branch information
kasparsd committed Mar 8, 2022
2 parents 489fb87 + fc606db commit 450eded
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classes/class-db-driver-wpdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public function insert_record( $data ) {
// Insert record meta.
foreach ( (array) $meta as $key => $vals ) {
foreach ( (array) $vals as $val ) {
$this->insert_meta( $record_id, $key, $val );
if ( is_scalar( $val ) && $val !== '' ) {
$this->insert_meta( $record_id, $key, $val );
}
}
}

Expand Down

0 comments on commit 450eded

Please sign in to comment.