Skip to content

Commit

Permalink
Merge branch 'main' of github.com:reformo/backendbase-utility
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Jul 26, 2023
2 parents 1dd6854 + 542ab92 commit 64d762c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Arrays/PayloadSanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
use function is_int;
use function is_string;
use function password_hash;
use function htmlspecialchars;

use const FILTER_FLAG_NO_ENCODE_QUOTES;
use const FILTER_SANITIZE_EMAIL;
use const FILTER_SANITIZE_STRING;
use const PASSWORD_ARGON2ID;

class PayloadSanitizer
Expand All @@ -27,7 +27,7 @@ public static function sanitize(?array $payload, ?array $allowHtml = [], ?string
$sanitizedPayload = [];
foreach ($payload as $key => $value) {
if (is_string($key)) {
$key = filter_var($key, FILTER_SANITIZE_STRING);
$key = htmlspecialchars($key);
}

$currentKeyValue = $keyValue . '.' . $key;
Expand Down Expand Up @@ -57,7 +57,7 @@ public static function sanitize(?array $payload, ?array $allowHtml = [], ?string
}

if (is_string($value)) {
$sanitizedPayload[$key] = filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
$sanitizedPayload[$key] = htmlspecialchars($value);
continue;
}

Expand Down

0 comments on commit 64d762c

Please sign in to comment.