Skip to content

Commit

Permalink
Dailymotion shortcode: fix failing test when ID is an empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Jul 20, 2016
1 parent da70237 commit 8f8b2ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/shortcodes/dailymotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function dailymotion_shortcode( $atts ) {
}
}

if ( isset( $atts['id'] ) ) {
if ( isset( $atts['id'] ) && ! empty( $atts['id'] ) ) {
$id = $atts['id'];
} else {
return '<!--Dailymotion error: bad or missing ID-->';
Expand Down

1 comment on commit 8f8b2ca

@georgestephanis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference, this could just be ! empty() -- there's no need to check isset as well, empty can handle that internally.

Please sign in to comment.