WordPress.org

Make WordPress Core

Changeset 1230 in tests


Ignore:
Timestamp:
03/03/13 21:10:38 (14 months ago)
Author:
ryan
Message:

Revert parts of [1215] to reflects changes for #WP21767

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/factory.php

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

    r1215 r1230  
    125125        $key = rand_str(); 
    126126        $value = 'Test\\singleslash'; 
    127         $expected = 'Test\\singleslash'; 
     127        $expected = 'Testsingleslash'; 
    128128        $value2 = 'Test\\\\doubleslash'; 
    129         $expected2 = 'Test\\\\doubleslash'; 
    130         $value3 = 'Test\oneslash'; 
    131         $expected3 = 'Test\oneslash'; 
     129        $expected2 = 'Test\\doubleslash'; 
    132130        $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) ); 
    133131        $this->assertFalse( delete_metadata( 'user', $this->author->ID, $key ) ); 
     
    152150        $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value2 ) ); 
    153151        $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 ) ); 
    164152    } 
    165153} 
  • trunk/tests/post/meta.php

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

    r1215 r1230  
    4141        $_POST['content'] = $this->slash_5; 
    4242        $_POST['excerpt'] = $this->slash_7; 
    43         $_POST = wp_slash( $_POST ); // the edit_post() function will strip slashes 
     43        $_POST = add_magic_quotes( $_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 = wp_slash( $_POST ); 
     57        $_POST = add_magic_quotes( $_POST ); 
    5858 
    5959        $post_id = edit_post(); 
     
    7575            'post_content' => $this->slash_3, 
    7676            'post_excerpt' => $this->slash_5, 
    77             'post_type' => 'post' 
     77            'post_type' => 'post', 
     78            'slashed' => false, 
    7879        )); 
    7980        $post = get_post( $id ); 
Note: See TracChangeset for help on using the changeset viewer.