Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. /**
  2. * Sanitizes Image Upload.
  3. *
  4. * @param string $input potentially dangerous data.
  5. */
  6. function counter_sanitize_image( $input ) {
  7. $filetype = wp_check_filetype( $input );
  8. if ( $filetype['ext'] && wp_ext2type( $filetype['ext'] ) === 'image' ) {
  9. return esc_url( $input );
  10. }
  11. return '';
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement