Skip to content

Commit

Permalink
Security hardending. Prevent empty array search. wpsharks/comment-mai…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswsinc committed Jun 5, 2015
1 parent 9a7c9a7 commit 6226987
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion comment-mail-pro/includes/classes/utils-sub.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,9 @@ public function query_total($post_id = NULL, array $args = array())
? ($sub_email_or_user_ids // Email or user IDs?
? " AND (`email` = '".esc_sql($sub_email)."'".
(isset($user_id) ? " OR `user_id` = '".esc_sql($user_id)."'" : '').
" OR `user_id` IN('".implode("','", array_map('esc_sql', $this->email_user_ids($sub_email, $no_cache)))."'))"
(($_sub_email_user_ids = $this->email_user_ids($sub_email, $no_cache))
? " OR `user_id` IN('".implode("','", array_map('esc_sql', $_sub_email_user_ids))."')"
: '').')' // ↑ Only if we DO have user IDs to look for.
: " AND `email` = '".esc_sql($sub_email)."'")
: ''). // End `sub_email` check.

Expand Down

0 comments on commit 6226987

Please sign in to comment.