WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/29/2020 06:48:02 PM (15 months ago)
Author:
whyisjake
Message:

General: WordPress updates

  • XML-RPC: Improve error messages for unprivileged users.
  • External Libraries: Disable deserialization in Requests_Utility_FilteredIterator
  • Embeds: Disable embeds on deactivated Multisite sites.
  • Coding standards: Modify escaping functions to avoid potential false positives.
  • XML-RPC: Return error message if attachment ID is incorrect.
  • Upgrade/install: Improve logic check when determining installation status.
  • Meta: Sanitize meta key before checking protection status.
  • Themes: Ensure that only privileged users can set a background image when a theme is using the deprecated custom background page.

Brings the changes from [49380,49382-49388] to the 5.1 branch.

Props xknown, zieladam, peterwilsoncc, whyisjake, desrosj, dd32.

Location:
branches/5.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.1

  • branches/5.1/tests/phpunit/tests/multisite/site.php

    r47321 r49395  
    475475        }
    476476
     477        function test_content_from_spam_blog_is_not_available() {
     478            $spam_blog_id = self::factory()->blog->create();
     479            switch_to_blog( $spam_blog_id );
     480            $post_data      = array(
     481                'post_title'   => 'Hello World!',
     482                'post_content' => 'Hello world content',
     483            );
     484            $post_id        = self::factory()->post->create( $post_data );
     485            $post           = get_post( $post_id );
     486            $spam_permalink = site_url() . '/?p=' . $post->ID;
     487            $spam_embed_url = get_post_embed_url( $post_id );
     488
     489            restore_current_blog();
     490            $this->assertNotEmpty( $spam_permalink );
     491            $this->assertEquals( $post_data['post_title'], $post->post_title );
     492
     493            update_blog_status( $spam_blog_id, 'spam', 1 );
     494
     495            $post_id = self::factory()->post->create(
     496                array(
     497                    'post_content' => "\n $spam_permalink \n",
     498                )
     499            );
     500            $post    = get_post( $post_id );
     501            $content = apply_filters( 'the_content', $post->post_content );
     502
     503            $this->assertNotContains( $post_data['post_title'], $content );
     504            $this->assertNotContains( "src=\"{$spam_embed_url}#?", $content );
     505        }
     506
    477507        function test_update_blog_status_make_spam_blog_action() {
    478508            global $test_action_counter;
Note: See TracChangeset for help on using the changeset viewer.