Skip to content

Commit

Permalink
Merge pull request #64 from alleyinteractive/bug/no-custom-targeting
Browse files Browse the repository at this point in the history
adding a ! empty check for no custom targeting variables
  • Loading branch information
timatron committed Jun 3, 2017
2 parents c51285c + fbc3860 commit 8f41655
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions php/ad-servers/class-ad-layers-dfp.php
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,12 @@ private function get_targeting_js_from_array( $custom_targeting ) {
private function get_targeting_array_from_custom_values( $custom_targeting ) {
$targeting_values = array();
foreach ( (array) $custom_targeting as $custom_target ) {
$values = ( isset( $custom_target['values'] ) ) ? $custom_target['values'] : null;
$targeting_value = $this->get_targeting_value( $custom_target['custom_variable'], $custom_target['source'], $values );
if ( ! empty( $targeting_value ) ) {
$targeting_values[ $custom_target['custom_variable'] ] = $targeting_value;
if ( ! empty( $custom_target['custom_variable'] ) ) {
$values = ( isset( $custom_target['values'] ) ) ? $custom_target['values'] : null;
$targeting_value = $this->get_targeting_value( $custom_target['custom_variable'], $custom_target['source'], $values );
if ( ! empty( $targeting_value ) ) {
$targeting_values[ $custom_target['custom_variable'] ] = $targeting_value;
}
}
}

Expand Down

0 comments on commit 8f41655

Please sign in to comment.