Skip to content

Commit

Permalink
Bug #54063: Use rawurldecode() and check invalid UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
JerrySmidt committed Oct 14, 2021
1 parent b7a87ac commit ee72d51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PostcodeNl/AddressAutocomplete/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function autocomplete(): void
{
$this->_populateSession();
[$context, $term] = $this->_getParameters(2);
$term = urldecode($term);
$term = wp_check_invalid_utf8(rawurldecode($term));

try
{
Expand Down Expand Up @@ -73,7 +73,7 @@ public function getDetails(): void
public function dutchAddressLookup(): void
{
[$postcode, $houseNumberAndAddition] = $this->_getParameters(2);
$houseNumberAndAddition = urldecode($houseNumberAndAddition);
$houseNumberAndAddition = wp_check_invalid_utf8(rawurldecode($houseNumberAndAddition));

preg_match('/^(?<houseNumber>\d{1,5})(?<addition>\D.*)?$/', $houseNumberAndAddition, $matches);
$houseNumber = isset($matches['houseNumber']) ? (int)$matches['houseNumber'] : null;
Expand Down

0 comments on commit ee72d51

Please sign in to comment.