Make WordPress Core

Changeset 5022


Ignore:
Timestamp:
03/10/2007 08:34:01 PM (20 years ago)
Author:
ryan
Message:

Prophylactic casting.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-includes/functions.php

    r4877 r5022  
    607607                $_post = & $post_cache[$post->ID];
    608608        } else {
     609                $post = (int) $post;
    609610                if ( $_post = wp_cache_get($post, 'pages') )
    610611                        return get_page($_post, $output);
    … …  
    710711                $_page = $page;
    711712        } else {
     713                $page = (int) $page;
    712714                if ( isset($GLOBALS['page']) && ($page == $GLOBALS['page']->ID) ) {
    713715                        $_page = & $GLOBALS['page'];
  • branches/2.0/wp-includes/template-functions-general.php

    r5010 r5022  
    146146        $author = get_query_var('author');
    147147        $author_name = get_query_var('author_name');
    148         $m = get_query_var('m');
    149         $year = get_query_var('year');
    150         $monthnum = get_query_var('monthnum');
    151         $day = get_query_var('day');
     148        $m = (int) get_query_var('m');
     149        $year = (int) get_query_var('year');
     150        $monthnum = (int) get_query_var('monthnum');
     151        $day = (int) get_query_var('day');
    152152        $title = '';
    153153
    … …  
    251251        global $month;
    252252
    253         $m = get_query_var('m');
    254         $year = get_query_var('year');
    255         $monthnum = get_query_var('monthnum');
     253        $m = (int) get_query_var('m');
     254        $year = (int) get_query_var('year');
     255        $monthnum = (int) get_query_var('monthnum');
    256256
    257257        if ( !empty($monthnum) && !empty($year) ) {
  • branches/2.1/wp-includes/general-template.php

    r5009 r5022  
    156156        $author = get_query_var('author');
    157157        $author_name = get_query_var('author_name');
    158         $m = get_query_var('m');
    159         $year = get_query_var('year');
    160         $monthnum = get_query_var('monthnum');
    161         $day = get_query_var('day');
     158        $m = (int) get_query_var('m');
     159        $year = (int) get_query_var('year');
     160        $monthnum = (int)get_query_var('monthnum');
     161        $day = (int) get_query_var('day');
    162162        $title = '';
    163163
    … …  
    262262        global $wp_locale;
    263263
    264         $m = get_query_var('m');
    265         $year = get_query_var('year');
    266         $monthnum = get_query_var('monthnum');
     264        $m = (int) get_query_var('m');
     265        $year = (int) get_query_var('year');
     266        $monthnum = (int) get_query_var('monthnum');
    267267
    268268        if ( !empty($monthnum) && !empty($year) ) {
  • branches/2.1/wp-includes/post.php

    r4822 r5022  
    106106                $_post = & $post_cache[$blog_id][$post->ID];
    107107        } else {
     108                $post = (int) $post;
    108109                if ( $_post = wp_cache_get($post, 'pages') )
    109110                        return get_page($_post, $output);
    … …  
    929930                $_page = $page;
    930931        } else {
     932                $page = (int) $page;
    931933                // first, check the cache
    932934                if ( ! ( $_page = wp_cache_get($page, 'pages') ) ) {
  • trunk/wp-includes/post.php

    r4990 r5022  
    106106                $_post = & $post_cache[$blog_id][$post->ID];
    107107        } else {
     108                $post = (int) $post;
    108109                if ( isset($post_cache[$blog_id][$post]) )
    109110                        $_post = & $post_cache[$blog_id][$post];
    … …  
    931932                $_page = $page;
    932933        } else {
     934                $page = (int) $page;
    933935                // first, check the cache
    934936                if ( ! ( $_page = wp_cache_get($page, 'pages') ) ) {
Note: See TracChangeset for help on using the changeset viewer.