Make WordPress Core


Ignore:
Timestamp:
08/31/2013 04:35:15 AM (11 years ago)
Author:
nacin
Message:

Case insensitivity for is_email_address_unsafe().

props jkudish.
fixes #25046.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ms.php

    r25111 r25197  
    828828     * @ticket 21570
    829829     */
    830     function test_is_email_address_unsafe() {
     830    function test_aggressiveness_of_is_email_address_unsafe() {
    831831        update_site_option( 'banned_email_domains', array( 'bar.com', 'foo.co' ) );
    832832
     
    840840    }
    841841
     842    /**
     843     * @ticket 25046
     844     */
     845    function test_case_sensitivity_of_is_email_address_unsafe() {
     846        update_site_option( 'banned_email_domains', array( 'baR.com', 'Foo.co', 'barfoo.COM', 'BAZ.com' ) );
     847
     848        foreach ( array( 'test@Bar.com', 'tEst@bar.com', 'test@barFoo.com', 'tEst@foo.bar.com', 'test@baz.Com' ) as $email_address ) {
     849            $this->assertTrue( is_email_address_unsafe( $email_address ), "$email_address should be UNSAFE" );
     850        }
     851
     852        foreach ( array( 'test@Foobar.com', 'test@Foo-bar.com', 'tEst@foobar.com', 'test@Subdomain.Foo.com', 'test@fooBAz.com' ) as $email_address ) {
     853            $this->assertFalse( is_email_address_unsafe( $email_address ), "$email_address should be SAFE" );
     854        }
     855
     856    }
    842857    /**
    843858     * @ticket 21552
Note: See TracChangeset for help on using the changeset viewer.