Is it safe to ignore PHPCS sanitization warning for $_FILES['tmp_name'] in WordPress?
I am handling file uploads in WordPress and have this code snippet: 'tmp_name' => $_FILES['attachments']['tmp_name'][$key], // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized PHP_CodeSniffer flags this with a security warning about unsanitized input, but I added an ignore comment because: tmp_name is generated by the PHP runtime (not user-provided directly). It is used internally by move_uploaded_file(), which handles the filesystem path safely. My questions are: Is this ignore justified, or are there hidden security risks with $_FILES['tmp_name'] that require sanitiz
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.