WordPress.org

Make WordPress Core

Changeset 20685


Ignore:
Timestamp:
05/02/12 16:29:39 (2 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

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

    r20537 r20685  
    13731373 * 
    13741374 * @param int $pagenum Optional. Page ID. 
    1375  * @return string 
    1376  */ 
    1377 function get_pagenum_link($pagenum = 1) { 
     1375 * @param bool $escape Optional. Whether to escape the URL for display, with esc_url(). Defaults to true. 
     1376*   Otherwise, prepares the URL with esc_url_raw(). 
     1377 * @return string 
     1378 */ 
     1379function get_pagenum_link($pagenum = 1, $escape = true ) { 
    13781380    global $wp_rewrite; 
    13791381 
     
    14261428    $result = apply_filters('get_pagenum_link', $result); 
    14271429 
    1428     return $result; 
     1430    if ( $escape ) 
     1431        return esc_url( $result ); 
     1432    else 
     1433        return esc_url_raw( $result ); 
    14291434} 
    14301435 
Note: See TracChangeset for help on using the changeset viewer.