Skip to content

Instantly share code, notes, and snippets.

@bka
Created October 12, 2023 14:03
Show Gist options
  • Save bka/19fd06189ec376f2971cf23016296414 to your computer and use it in GitHub Desktop.
Save bka/19fd06189ec376f2971cf23016296414 to your computer and use it in GitHub Desktop.
diff --git Plugin/Webapi/Controller/Rest/ValidateCustomerData.php Plugin/Webapi/Controller/Rest/ValidateCustomerData.php
index ad2d8ed..63551ff 100644
--- Plugin/Webapi/Controller/Rest/ValidateCustomerData.php
+++ Plugin/Webapi/Controller/Rest/ValidateCustomerData.php
@@ -28,8 +28,8 @@ class ValidateCustomerData
*/
public function beforeOverride(ParamsOverrider $subject, array $inputData, array $parameters): array
{
- if (isset($inputData[self:: CUSTOMER_KEY])) {
- $inputData[self:: CUSTOMER_KEY] = $this->validateInputData($inputData[self:: CUSTOMER_KEY]);
+ if (isset($inputData[self::CUSTOMER_KEY])) {
+ $inputData[self::CUSTOMER_KEY] = $this->validateInputData($inputData[self::CUSTOMER_KEY]);
}
return [$inputData, $parameters];
}
@@ -45,7 +45,7 @@ class ValidateCustomerData
$result = [];
$data = array_filter($inputData, function ($k) use (&$result) {
- $key = is_string($k) ? strtolower($k) : $k;
+ $key = is_string($k) ? strtolower(str_replace('_', "", $k)) : $k;
return !isset($result[$key]) && ($result[$key] = true);
}, ARRAY_FILTER_USE_KEY);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment