WordPress.org

Make WordPress Core

Changeset 1215 in tests


Ignore:
Timestamp:
02/14/13 22:51:37 (14 months ago)
Author:
ryan
Message:

Update for [WP23416]

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/factory.php

    r1128 r1215  
    7878 
    7979    function create_object( $args ) { 
    80         return wp_insert_comment( $this->addslashes_deep( $args ) ); 
     80        return wp_insert_comment( $args ); 
    8181    } 
    8282 
    8383    function update_object( $comment_id, $fields ) { 
    8484        $fields['comment_ID'] = $comment_id; 
    85         return wp_update_comment( $this->addslashes_deep( $fields ) ); 
     85        return wp_update_comment( $fields ); 
    8686    } 
    8787 
  • trunk/tests/admin/includesMisc.php

    r909 r1215  
    77    function test_shorten_url() { 
    88        $tests = array( 
    9             // strip slashes 
    10             'wordpress\.org/about/philosophy' 
    11                 => 'wordpress.org/about/philosophy', // strip slashes 
     9            'wordpress.org/about/philosophy' 
     10                => 'wordpress.org/about/philosophy', 
    1211            'http://wordpress.org/about/philosophy/' 
    1312                => 'wordpress.org/about/philosophy', // remove http, trailing slash 
  • trunk/tests/meta.php

    r1207 r1215  
    125125        $key = rand_str(); 
    126126        $value = 'Test\\singleslash'; 
    127         $expected = 'Testsingleslash'; 
     127        $expected = 'Test\\singleslash'; 
    128128        $value2 = 'Test\\\\doubleslash'; 
    129         $expected2 = 'Test\\doubleslash'; 
     129        $expected2 = 'Test\\\\doubleslash'; 
     130        $value3 = 'Test\oneslash'; 
     131        $expected3 = 'Test\oneslash'; 
    130132        $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) ); 
    131133        $this->assertFalse( delete_metadata( 'user', $this->author->ID, $key ) ); 
     
    150152        $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value2 ) ); 
    151153        $this->assertEquals( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) ); 
     154        $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) ); 
     155        $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) ); 
     156        $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) ); 
     157 
     158        $this->assertInternalType( 'int', add_metadata( 'user', $this->author->ID, $key, $value3 ) ); 
     159        $this->assertEquals( $expected3, get_metadata( 'user', $this->author->ID, $key, true ) ); 
     160        $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) ); 
     161        $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) ); 
     162        $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value3 ) ); 
     163        $this->assertEquals( $expected3, get_metadata( 'user', $this->author->ID, $key, true ) ); 
    152164    } 
    153165} 
  • trunk/tests/post/meta.php

    r1207 r1215  
    220220        $this->assertTrue( update_meta( $mid1, 'unique_update', addslashes( $data ) ) ); 
    221221        $meta = get_metadata_by_mid( 'post', $mid1 ); 
    222         $this->assertEquals( $data, $meta->meta_value ); 
     222        $this->assertEquals( addslashes( $data ), $meta->meta_value ); 
    223223    } 
    224224 
  • trunk/tests/post/slashes.php

    r1148 r1215  
    4141        $_POST['content'] = $this->slash_5; 
    4242        $_POST['excerpt'] = $this->slash_7; 
    43         $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes 
     43        $_POST = wp_slash( $_POST ); // the edit_post() function will strip slashes 
    4444 
    4545        $post_id = edit_post(); 
     
    5555        $_POST['content'] = $this->slash_4; 
    5656        $_POST['excerpt'] = $this->slash_6; 
    57         $_POST = add_magic_quotes( $_POST ); 
     57        $_POST = wp_slash( $_POST ); 
    5858 
    5959        $post_id = edit_post(); 
Note: See TracChangeset for help on using the changeset viewer.