Forked from thefuxia/t5-extend-email-checks.php
Last active
December 24, 2015 14:09
-
-
Save tcbarrett/6811025 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php # -*- coding: utf-8 -*- | |
/* | |
Plugin Name: T5 Extend Email Checks | |
Description: Overrides the results of the functions <code>is_email()</code> and <code>sanitize_email()</code>. Allows for example <code>me@localhost</code> or punycode encoded email adresses by using PHP’s internal filter function. | |
Version: 2012.08.29 | |
Plugin URI: http://toscho.de/?p=2195 | |
Author: Thomas Scholz | |
Author URI: http://toscho.de | |
License: MIT | |
*/ | |
! defined( 'ABSPATH' ) and exit; | |
if ( ! function_exists( 't5_extend_email_checks' ) ) | |
{ | |
add_filter( 'is_email', 't5_extend_email_checks', 10, 2 ); | |
add_filter( 'sanitize_email', 't5_extend_email_checks', 10, 2 ); | |
function t5_extend_email_checks( $result, $email ) | |
{ | |
return filter_var( $email, FILTER_VALIDATE_EMAIL ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that apostrophes are escaped by WordPress, so they are still invalid.