WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/03/2016 05:17:26 AM (4 years ago)
Author:
pento
Message:

REST API: Site URL setting should not be present on multisite installations.

The siteurl setting is registered and made available to the REST API. On a multisite installation, this setting is not configurable from the General Settings screen, but due to the above it is configurable from the REST API.

Merge of [39468] to the 4.7 branch.

Props peterwilsoncc.
Fixes #39005.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/tests/phpunit/tests/rest-api/rest-settings-controller.php

    r39058 r39469  
    5050        $response = $this->server->dispatch( $request );
    5151        $data = $response->get_data();
    52 
    53         $this->assertEquals( 200, $response->get_status() );
    54         $this->assertEquals( array(
     52        $actual = array_keys( $data );
     53
     54        $expected = array(
    5555            'title',
    5656            'description',
     
    6868            'default_ping_status',
    6969            'default_comment_status',
    70         ), array_keys( $data ) );
     70        );
     71
     72        if ( is_multisite() ) {
     73            $expected = array_diff( $expected, array( 'url' ) );
     74        }
     75
     76        sort( $expected );
     77        sort( $actual );
     78
     79        $this->assertEquals( 200, $response->get_status() );
     80        $this->assertEquals( $expected, $actual );
    7181    }
    7282
Note: See TracChangeset for help on using the changeset viewer.