WordPress.org

Make WordPress Core

Changeset 37812


Ignore:
Timestamp:
06/21/2016 02:53:46 PM (3 years ago)
Author:
nbachiyski
Message:

Admin: escape URL-encoded permalinks

Merge of [37801] to the 4.2 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/src/wp-admin/includes/post.php

    r37776 r37812  
    13001300        }
    13011301
    1302         $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
    1303         $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
     1302        $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . esc_html( $post_name_abridged ) . '</span>';
     1303        $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
    13041304        $pretty_permalink = str_replace( array( '%pagename%', '%postname%' ), $post_name, urldecode( $permalink ) );
    13051305
     
    13081308        $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
    13091309        $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __( 'Edit' ) . "</a></span>\n";
    1310         $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
     1310        $return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
    13111311    }
    13121312
     
    13221322            }
    13231323
    1324             $return .= "<span id='view-post-btn'><a href='" . $pretty_permalink . "' class='button button-small'>$view_post</a></span>\n";
     1324            $return .= "<span id='view-post-btn'><a href='" . esc_url( $pretty_permalink ) . "' class='button button-small'>$view_post</a></span>\n";
    13251325        }
    13261326    }
Note: See TracChangeset for help on using the changeset viewer.