From 3c2167d60b22032956e39fa536cc7684126a5b54 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 23 Aug 2024 16:39:19 +0200 Subject: Charset for JSON exchanges (#6710) Apply some minor recommendations from Snyk scanner --- lib/Minz/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 8121eb104..63464e8f1 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -440,7 +440,7 @@ class Minz_Request { * Allows receiving POST data as application/json */ private static function initJSON(): void { - if ('application/json' !== self::extractContentType()) { + if (!str_starts_with(self::extractContentType(), 'application/json')) { return; } $ORIGINAL_INPUT = file_get_contents('php://input', false, null, 0, 1048576); -- cgit v1.2.3