Phpman88
-
Posts
1 -
Joined
-
Last visited
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Sanitize File Names WordPress
in Applications
Posted
I recently submitted a plugin to WordPress and they told me to sanitize my file name here is the examples they gave me.
image-framer/image-framer.php:135: $targetFile = $targetPath . '/imageframer/' . basename($_FILES['image']['name'][$i]); image-framer/image-framer.php:138: $returnResponse[$i] = $dir['baseurl'] . '/imageframer/' . $_FILES['image']['name'][$i]; image-framer/image-framer.php:162: $targetFile = $targetPath . '/imageframer/' . basename($_FILES['uploadimg']['name']); image-framer/image-framer.php:165: $returnResponse = $dir['baseurl'] . '/imageframer/' . $_FILES['uploadimg']['name']; image-framer/src/Validation.php:13: $imageFileType = strtolower(pathinfo($targetPath . '/imageframer/' . basename($_FILES['image']['name'][$index]), PATHINFO_EXTENSION));
How would I go about sanitizing file names? Thanks all for your help.