Making WordPress.org

Changeset 10189


Ignore:
Timestamp:
08/19/2020 07:28:11 AM (4 years ago)
Author:
tellyworth
Message:

Plugin dir: prevent false trigger of the Test button.

See #5303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-block-validator.php

    r10181 r10189  
    146146    protected static function handle_test() {
    147147        $post = get_post( intval( $_POST['plugin-id'] ) );
    148         if ( $post && wp_verify_nonce( $_POST['block-directory-nonce'], 'block-directory-test-' . $post->ID ) ) {
     148        if ( $post && 'test' === $_POST['block-directory-test'] && wp_verify_nonce( $_POST['block-directory-nonce'], 'block-directory-test-' . $post->ID ) ) {
    149149            if ( wp_cache_get( "plugin-e2e-test-{$post->ID}", 'plugin-test' ) ) {
    150150                echo '<div class="notice notice-warning notice-alt"><p>' . __( 'Test already in progress.', 'wporg-plugins' ) . '</p></div>';
Note: See TracChangeset for help on using the changeset viewer.