mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 07:37:44 +02:00
Prophylactic casting.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@5022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4f26c48328
commit
f01df05ac1
@ -606,6 +606,7 @@ function &get_post(&$post, $output = OBJECT) {
|
|||||||
$post_cache[$post->ID] = &$post;
|
$post_cache[$post->ID] = &$post;
|
||||||
$_post = & $post_cache[$post->ID];
|
$_post = & $post_cache[$post->ID];
|
||||||
} else {
|
} else {
|
||||||
|
$post = (int) $post;
|
||||||
if ( $_post = wp_cache_get($post, 'pages') )
|
if ( $_post = wp_cache_get($post, 'pages') )
|
||||||
return get_page($_post, $output);
|
return get_page($_post, $output);
|
||||||
elseif ( isset($post_cache[$post]) )
|
elseif ( isset($post_cache[$post]) )
|
||||||
@ -709,6 +710,7 @@ function &get_page(&$page, $output = OBJECT) {
|
|||||||
wp_cache_add($page->ID, $page, 'pages');
|
wp_cache_add($page->ID, $page, 'pages');
|
||||||
$_page = $page;
|
$_page = $page;
|
||||||
} else {
|
} else {
|
||||||
|
$page = (int) $page;
|
||||||
if ( isset($GLOBALS['page']) && ($page == $GLOBALS['page']->ID) ) {
|
if ( isset($GLOBALS['page']) && ($page == $GLOBALS['page']->ID) ) {
|
||||||
$_page = & $GLOBALS['page'];
|
$_page = & $GLOBALS['page'];
|
||||||
wp_cache_add($_page->ID, $_page, 'pages');
|
wp_cache_add($_page->ID, $_page, 'pages');
|
||||||
|
@ -145,10 +145,10 @@ function wp_title($sep = '»', $display = true) {
|
|||||||
$category_name = get_query_var('category_name');
|
$category_name = get_query_var('category_name');
|
||||||
$author = get_query_var('author');
|
$author = get_query_var('author');
|
||||||
$author_name = get_query_var('author_name');
|
$author_name = get_query_var('author_name');
|
||||||
$m = get_query_var('m');
|
$m = (int) get_query_var('m');
|
||||||
$year = get_query_var('year');
|
$year = (int) get_query_var('year');
|
||||||
$monthnum = get_query_var('monthnum');
|
$monthnum = (int) get_query_var('monthnum');
|
||||||
$day = get_query_var('day');
|
$day = (int) get_query_var('day');
|
||||||
$title = '';
|
$title = '';
|
||||||
|
|
||||||
// If there's a category
|
// If there's a category
|
||||||
@ -250,9 +250,9 @@ function single_cat_title($prefix = '', $display = true ) {
|
|||||||
function single_month_title($prefix = '', $display = true ) {
|
function single_month_title($prefix = '', $display = true ) {
|
||||||
global $month;
|
global $month;
|
||||||
|
|
||||||
$m = get_query_var('m');
|
$m = (int) get_query_var('m');
|
||||||
$year = get_query_var('year');
|
$year = (int) get_query_var('year');
|
||||||
$monthnum = get_query_var('monthnum');
|
$monthnum = (int) get_query_var('monthnum');
|
||||||
|
|
||||||
if ( !empty($monthnum) && !empty($year) ) {
|
if ( !empty($monthnum) && !empty($year) ) {
|
||||||
$my_year = $year;
|
$my_year = $year;
|
||||||
|
Loading…
Reference in New Issue
Block a user