Make WordPress Core

Ticket #13383: 13383-escape-preview.diff

File 13383-escape-preview.diff, 1.9 KB (added by zeo, 14 years ago)

escape preview link

  • wp-admin/includes/template.php

     
    13611361                        }
    13621362                        if ( in_array($post->post_status, array('pending', 'draft')) ) {
    13631363                                if ( current_user_can($post_type_object->cap->edit_post, $post->ID) )
    1364                                         $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($post->ID) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     1364                                        $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
    13651365                        } elseif ( 'trash' != $post->post_status ) {
    13661366                                $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
    13671367                        }
     
    15831583                }
    15841584                if ( in_array($post->post_status, array('pending', 'draft')) ) {
    15851585                        if ( current_user_can($post_type_object->cap->edit_post, $page->ID) )
    1586                                 $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($page->ID) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     1586                                $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($page->ID) ) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
    15871587                } elseif ( $post->post_status != 'trash' ) {
    15881588                        $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
    15891589                }