WordPress.org

Make WordPress Core

Ticket #13328: 13328.brute-force.diff

File 13328.brute-force.diff, 1.1 KB (added by nacin, 7 years ago)
  • wp-admin/includes/meta-boxes.php

     
    3838<div id="preview-action">
    3939<?php
    4040if ( 'publish' == $post->post_status ) {
    41         $preview_link = esc_url(get_permalink($post->ID));
    42         $preview_button = __('Preview Changes');
     41        $preview_link = esc_url( get_permalink( $post->ID ) );
     42        $preview_button = __( 'Preview Changes' );
    4343} else {
    44         $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
    45         $preview_button = __('Preview');
     44        $preview_link = get_permalink( $post->ID );
     45        if ( is_ssl() )
     46                $preview_link = str_replace( 'http://', 'https://', $preview_link );
     47        $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
     48        $preview_button = __( 'Preview' );
    4649}
    4750?>
    4851<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>