Prophylactic casting.

git-svn-id: http://svn.automattic.com/wordpress/branches/2.1@5022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-03-10 20:34:01 +00:00
parent faabd2d6a9
commit 21d3d46bbc
2 changed files with 9 additions and 7 deletions

View File

@ -155,10 +155,10 @@ function wp_title($sep = '»', $display = true) {
$category_name = get_query_var('category_name');
$author = get_query_var('author');
$author_name = get_query_var('author_name');
$m = get_query_var('m');
$year = get_query_var('year');
$monthnum = get_query_var('monthnum');
$day = get_query_var('day');
$m = (int) get_query_var('m');
$year = (int) get_query_var('year');
$monthnum = (int)get_query_var('monthnum');
$day = (int) get_query_var('day');
$title = '';
// If there's a category
@ -261,9 +261,9 @@ function single_cat_title($prefix = '', $display = true ) {
function single_month_title($prefix = '', $display = true ) {
global $wp_locale;
$m = get_query_var('m');
$year = get_query_var('year');
$monthnum = get_query_var('monthnum');
$m = (int) get_query_var('m');
$year = (int) get_query_var('year');
$monthnum = (int) get_query_var('monthnum');
if ( !empty($monthnum) && !empty($year) ) {
$my_year = $year;

View File

@ -105,6 +105,7 @@ function &get_post(&$post, $output = OBJECT) {
$post_cache[$blog_id][$post->ID] = &$post;
$_post = & $post_cache[$blog_id][$post->ID];
} else {
$post = (int) $post;
if ( $_post = wp_cache_get($post, 'pages') )
return get_page($_post, $output);
elseif ( isset($post_cache[$blog_id][$post]) )
@ -928,6 +929,7 @@ function &get_page(&$page, $output = OBJECT) {
wp_cache_add($page->ID, $page, 'pages');
$_page = $page;
} else {
$page = (int) $page;
// first, check the cache
if ( ! ( $_page = wp_cache_get($page, 'pages') ) ) {
// not in the page cache?