Make WordPress Core


Ignore:
Timestamp:
12/13/2018 01:55:22 AM (6 years ago)
Author:
peterwilsoncc
Message:

Multisite: Validate activation links.

Merges [44048] to the 4.0 branch.

Location:
branches/4.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

  • branches/4.0/src/wp-includes/ms-deprecated.php

    r27716 r44069  
    241241
    242242    $ref = '';
    243     if ( isset( $_GET['ref'] ) )
    244         $ref = $_GET['ref'];
    245     if ( isset( $_POST['ref'] ) )
    246         $ref = $_POST['ref'];
     243    if ( isset( $_GET['ref'] ) && isset( $_POST['ref'] ) && $_GET['ref'] !== $_POST['ref'] ) {
     244        wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
     245    } elseif ( isset( $_POST['ref'] ) ) {
     246        $ref = $_POST[ 'ref' ];
     247    } elseif ( isset( $_GET['ref'] ) ) {
     248        $ref = $_GET[ 'ref' ];
     249    }
    247250
    248251    if ( $ref ) {
     
    257260
    258261    $url = wpmu_admin_redirect_add_updated_param( $url );
    259     if ( isset( $_GET['redirect'] ) ) {
     262    if ( isset( $_GET['redirect'] ) && isset( $_POST['redirect'] ) && $_GET['redirect'] !== $_POST['redirect'] ) {
     263        wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
     264    } elseif ( isset( $_GET['redirect'] ) ) {
    260265        if ( substr( $_GET['redirect'], 0, 2 ) == 's_' )
    261266            $url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );
Note: See TracChangeset for help on using the changeset viewer.