From 44cfde6f0419c5e6b768f995e73d005b0a86d461 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 5 Oct 2006 03:12:24 +0000 Subject: [PATCH] fix usage of $m and return behavior in single_month_title(). fixes #3207 git-svn-id: http://svn.automattic.com/wordpress/trunk@4346 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 063407e54..e5c9021be 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -260,13 +260,17 @@ function single_month_title($prefix = '', $display = true ) { $my_month = $wp_locale->get_month($monthnum); } elseif ( !empty($m) ) { $my_year = substr($m, 0, 4); - $my_month = $wp_locale->get_month($m); + $my_month = $wp_locale->get_month(substr($m, 4, 2)); } - if ( !empty($my_month) && $display ) - echo $prefix . $my_month . $prefix . $my_year; - else - return $monthnum; + if ( empty($my_month) ) + return false; + + $result = $prefix . $my_month . $prefix . $my_year; + + if ( !$display ) + return $result; + echo $result; }