Make WordPress Core


Ignore:
Timestamp:
10/29/2020 06:39:14 PM (4 years 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.4 branch.

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

Location:
branches/5.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

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

    r47318 r49391  
    489489        }
    490490
     491        function test_content_from_spam_blog_is_not_available() {
     492            $spam_blog_id = self::factory()->blog->create();
     493            switch_to_blog( $spam_blog_id );
     494            $post_data      = array(
     495                'post_title'   => 'Hello World!',
     496                'post_content' => 'Hello world content',
     497            );
     498            $post_id        = self::factory()->post->create( $post_data );
     499            $post           = get_post( $post_id );
     500            $spam_permalink = site_url() . '/?p=' . $post->ID;
     501            $spam_embed_url = get_post_embed_url( $post_id );
     502
     503            restore_current_blog();
     504            $this->assertNotEmpty( $spam_permalink );
     505            $this->assertEquals( $post_data['post_title'], $post->post_title );
     506
     507            update_blog_status( $spam_blog_id, 'spam', 1 );
     508
     509            $post_id = self::factory()->post->create(
     510                array(
     511                    'post_content' => "\n $spam_permalink \n",
     512                )
     513            );
     514            $post    = get_post( $post_id );
     515            $content = apply_filters( 'the_content', $post->post_content );
     516
     517            $this->assertNotContains( $post_data['post_title'], $content );
     518            $this->assertNotContains( "src=\"{$spam_embed_url}#?", $content );
     519        }
     520
    491521        function test_update_blog_status_make_spam_blog_action() {
    492522            global $test_action_counter;
Note: See TracChangeset for help on using the changeset viewer.