Sanitizing file & directory form input
The function that you would want to use is sanitize_text_field() which among other things, strips all HTML tags, and remove line breaks, tabs and extra white space. // This worked fine for me – I got /directory/subdirectory/ $value = sanitize_text_field( ‘/directory/subdirectory/’ ); // And so does this one – I got /thisfile.min.js $value = sanitize_text_field( … Read more