From 4dcdc247f61f24fba76ddc426e14edd25a6828f0 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 2 Apr 2010 00:07:59 +0000 Subject: [PATCH] Handle uppercase html entities in get_next_posts_link() & get_next_comments_link() (and family) $labels. Fixes #4152 git-svn-id: https://develop.svn.wordpress.org/trunk@13922 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 4043d7fb66..f4d9da273e 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1459,9 +1459,8 @@ function next_posts( $max_page = 0, $echo = true ) { function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) { global $paged, $wp_query; - if ( !$max_page ) { + if ( !$max_page ) $max_page = $wp_query->max_num_pages; - } if ( !$paged ) $paged = 1; @@ -1470,7 +1469,7 @@ function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) { if ( !is_single() && ( empty($paged) || $nextpage <= $max_page) ) { $attr = apply_filters( 'next_posts_link_attributes', '' ); - return '". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; + return '" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) . ''; } } @@ -1585,7 +1584,7 @@ function get_posts_nav_link( $args = array() ) { if ( $max_num_pages > 1 ) { $return = get_previous_posts_link($args['prelabel']); - $return .= preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $args['sep']); + $return .= preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $args['sep']); $return .= get_next_posts_link($args['nxtlabel']); } } @@ -1674,7 +1673,7 @@ function get_next_comments_link( $label = '', $max_page = 0 ) { if ( empty($label) ) $label = __('Newer Comments »'); - return ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; + return ''. preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) .''; } /** @@ -1711,7 +1710,7 @@ function get_previous_comments_link( $label = '' ) { if ( empty($label) ) $label = __('« Older Comments'); - return '' . preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; + return '' . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) .''; } /**