From 3a4671f530d4e70dd5f7fa347aceaf28980514ff Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 11 Nov 2010 16:22:18 +0000 Subject: [PATCH] Prevent stomping of global. Props prettyboymp. fixes #13945 git-svn-id: http://svn.automattic.com/wordpress/trunk@16303 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 4 ++-- wp-includes/general-template.php | 10 +++++----- wp-includes/query.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 30cb0d616..e27386c8b 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1344,8 +1344,8 @@ function wp_get_http_headers( $url, $deprecated = false ) { * @return int 1 when new day, 0 if not a new day. */ function is_new_day() { - global $day, $previousday; - if ( $day != $previousday ) + global $currentday, $previousday; + if ( $currentday != $previousday ) return 1; else return 0; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 53a3a83f7..5fdcd56dc 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1352,13 +1352,13 @@ function the_date_xml() { * @return string|null Null if displaying, string if retrieving. */ function the_date( $d = '', $before = '', $after = '', $echo = true ) { - global $day, $previousday; + global $currentday, $previousday; $the_date = ''; - if ( $day != $previousday ) { + if ( $currentday != $previousday ) { $the_date .= $before; $the_date .= get_the_date( $d ); $the_date .= $after; - $previousday = $day; + $previousday = $currentday; $the_date = apply_filters('the_date', $the_date, $d, $before, $after); @@ -1564,11 +1564,11 @@ function the_weekday() { function the_weekday_date($before='',$after='') { global $wp_locale, $post, $day, $previousweekday; $the_weekday_date = ''; - if ( $day != $previousweekday ) { + if ( $currentday != $previousweekday ) { $the_weekday_date .= $before; $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false)); $the_weekday_date .= $after; - $previousweekday = $day; + $previousweekday = $currentday; } $the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after); echo $the_weekday_date; diff --git a/wp-includes/query.php b/wp-includes/query.php index e58b63434..f926daaa4 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -3188,13 +3188,13 @@ function wp_old_slug_redirect() { * @return bool True when finished. */ function setup_postdata($post) { - global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages; + global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages; $id = (int) $post->ID; $authordata = get_userdata($post->post_author); - $day = mysql2date('d.m.y', $post->post_date, false); + $currentday = mysql2date('d.m.y', $post->post_date, false); $currentmonth = mysql2date('m', $post->post_date, false); $numpages = 1; $page = get_query_var('page');