Skip to content

Commit

Permalink
When supplying ip in an IN filter, pad it so it works as expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Aug 5, 2022
1 parent b5a5815 commit f3f534c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code_igniter/application/helpers/response_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,10 @@ function response_get_query_filter($query_string, $type = '')
// $value = str_replace('\"', '"', $value);
// $value = str_replace('"', '\"', $value);
$value = mysqli_real_escape_string($instance->db->conn_id, $value);
if (($query->name === 'ip' or stripos($query->name, '.ip') !== false) and filter_var($value, FILTER_VALIDATE_IP)) {
# We have an IP addresses - pad it
$value = ip_address_to_db($value);
}
$query->value .= '"' . $value . '",';
}
$query->value = trim($query->value, ',');
Expand Down

0 comments on commit f3f534c

Please sign in to comment.