WordPress.org

Make WordPress Core

Changeset 21084


Ignore:
Timestamp:
06/15/2012 05:02:39 PM (6 years ago)
Author:
markjaquith
Message:

Always escape the output of get_pagenum_link(). fixes #14556 for the 3.3 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/wp-includes/link-template.php

    r19054 r21084  
    13761376 *
    13771377 * @param int $pagenum Optional. Page ID.
    1378  * @return string
    1379  */
    1380 function get_pagenum_link($pagenum = 1) {
     1378 * @param bool $escape Optional. Whether to escape the URL for display, with esc_url(). Defaults to true.
     1379*   Otherwise, prepares the URL with esc_url_raw().
     1380 * @return string
     1381 */
     1382function get_pagenum_link($pagenum = 1, $escape = true ) {
    13811383    global $wp_rewrite;
    13821384
     
    14291431    $result = apply_filters('get_pagenum_link', $result);
    14301432
    1431     return $result;
     1433    if ( $escape )
     1434        return esc_url( $result );
     1435    else
     1436        return esc_url_raw( $result );
    14321437}
    14331438
Note: See TracChangeset for help on using the changeset viewer.