WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/02/2010 12:07:59 AM (12 years ago)
Author:
dd32
Message:

Handle uppercase html entities in get_next_posts_link() & get_next_comments_link() (and family) $labels. Fixes #4152

File:
1 edited

Legend:

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

    r13884 r13922  
    14601460    global $paged, $wp_query;
    14611461
    1462     if ( !$max_page ) {
     1462    if ( !$max_page )
    14631463        $max_page = $wp_query->max_num_pages;
    1464     }
    14651464
    14661465    if ( !$paged )
     
    14711470    if ( !is_single() && ( empty($paged) || $nextpage <= $max_page) ) {
    14721471        $attr = apply_filters( 'next_posts_link_attributes', '' );
    1473         return '<a href="' . next_posts( $max_page, false ) . "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
     1472        return '<a href="' . next_posts( $max_page, false ) . "\" $attr>" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) . '</a>';
    14741473    }
    14751474}
     
    15861585        if ( $max_num_pages > 1 ) {
    15871586            $return = get_previous_posts_link($args['prelabel']);
    1588             $return .= preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $args['sep']);
     1587            $return .= preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $args['sep']);
    15891588            $return .= get_next_posts_link($args['nxtlabel']);
    15901589        }
     
    16751674        $label = __('Newer Comments &raquo;');
    16761675
    1677     return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
     1676    return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) .'</a>';
    16781677}
    16791678
     
    17121711        $label = __('&laquo; Older Comments');
    17131712
    1714     return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
     1713    return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) .'</a>';
    17151714}
    17161715
Note: See TracChangeset for help on using the changeset viewer.