WordPress build repository browser

Changeset 62843


Ignore:
Timestamp:
09/17/2026 05:40:12 PM (5 weeks ago)
Author:
adamsilverstein
Message:

Administration: Add authorization check to wp_ajax_sample_permalink().

Props peterwilsoncc, westonruter, jorbin.

Built from ​https://develop.svn.wordpress.org/trunk@63669

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r62831 r62843  
    20602060        check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
    20612061        $post_id = isset( $_POST['post_id'] ) ? (int) $_POST['post_id'] : 0;
     2062        if ( ! $post_id ) {
     2063                // Bypass call to get_preview_post_link() for unspecified post ID.
     2064                wp_die( '' );
     2065        }
     2066        if ( ! current_user_can( 'edit_post', $post_id ) ) {
     2067                wp_die( -1 );
     2068        }
    20622069        wp_die( get_preview_post_link( $post_id ) );
    20632070}
    … …  
    20712078        check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' );
    20722079        $post_id = isset( $_POST['post_id'] ) ? (int) $_POST['post_id'] : 0;
    2073         $title   = $_POST['new_title'] ?? '';
    2074         $slug    = $_POST['new_slug'] ?? null;
     2080        if ( ! $post_id ) {
     2081                // Bypass call to get_sample_permalink_html() for unspecified post ID.
     2082                wp_die( '' );
     2083        }
     2084        if ( ! current_user_can( 'edit_post', $post_id ) ) {
     2085                wp_die( -1 );
     2086        }
     2087        $title = $_POST['new_title'] ?? '';
     2088        $slug  = $_POST['new_slug'] ?? null;
    20752089        wp_die( get_sample_permalink_html( $post_id, $title, $slug ) );
    20762090}
  • trunk/wp-includes/version.php

    r62839 r62843  
    1717 * @global string $wp_version
    1818 */
    19 $wp_version = '7.2-alpha-63665';
     19$wp_version = '7.2-alpha-63669';
    2020
    2121/**
Note: See TracChangeset for help on using the changeset viewer.