Skip to content

Commit

Permalink
Prevent array to string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
rubengc committed Feb 19, 2020
1 parent e44a689 commit 42bcb97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions includes/CMB2_Utils.php
Expand Up @@ -589,6 +589,7 @@ public static function concat_attrs( $attrs, $attr_exclude = array() ) {
foreach ( $attrs as $attr => $val ) {
$excluded = in_array( $attr, (array) $attr_exclude, true );
$empty = false === $val && 'value' !== $attr;
$val = is_array( $val ) ? implode( ',', $val ) : $val;
if ( ! $excluded && ! $empty ) {
// if data attribute, use single quote wraps, else double.
$quotes = self::is_data_attribute( $attr, 'data-' ) ? "'" : '"';
Expand Down

0 comments on commit 42bcb97

Please sign in to comment.