Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Sanitizes Image Upload.
- *
- * @param string $input potentially dangerous data.
- */
- function counter_sanitize_image( $input ) {
- $filetype = wp_check_filetype( $input );
- if ( $filetype['ext'] && wp_ext2type( $filetype['ext'] ) === 'image' ) {
- return esc_url( $input );
- }
- return '';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement