Skip to content

Commit

Permalink
verify that $hooks is an array before attempting to generate a where …
Browse files Browse the repository at this point in the history
…clause from it.
  • Loading branch information
prettyboymp committed Oct 25, 2023
1 parent 73078f3 commit dd064ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/data-stores/ActionScheduler_DBStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ protected function claim_actions( $claim_id, $limit, \DateTime $before_date = nu
$params[] = $date->format( 'Y-m-d H:i:s' );
$params[] = self::STATUS_PENDING;

if ( ! empty( $hooks ) ) {
if ( is_array( $hooks ) && ! empty( $hooks ) ) {
$placeholders = array_fill( 0, count( $hooks ), '%s' );
$where .= ' AND hook IN (' . join( ', ', $placeholders ) . ')';
$params = array_merge( $params, array_values( $hooks ) );
Expand Down

0 comments on commit dd064ee

Please sign in to comment.