More int casts

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@5100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-03-25 23:12:38 +00:00
parent a359d5977b
commit bb07c58477
8 changed files with 12 additions and 12 deletions

View File

@ -90,7 +90,7 @@ function wp_insert_comment($commentdata) {
('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$comment_author_IP', '$comment_date', '$comment_date_gmt', '$comment_content', '$comment_approved', '$comment_agent', '$comment_type', '$comment_parent', '$user_id')
");
$id = $wpdb->insert_id;
$id = (int) $wpdb->insert_id;
if ( $comment_approved == 1) {
$count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_approved = '1'");
@ -224,7 +224,7 @@ function get_comments_number( $post_id = 0 ) {
$post_id = (int) $post_id;
if ( !$post_id )
$post_id = $id;
$post_id = (int) $id;
if ( !isset($comment_count_cache[$post_id]) )
$comment_count_cache[$id] = $wpdb->get_var("SELECT comment_count FROM $wpdb->posts WHERE ID = '$post_id'");

View File

@ -47,7 +47,7 @@ function wp_insert_post($postarr = array()) {
// Get the post ID.
if ( $update )
$post_ID = $ID;
$post_ID = (int) $ID;
// Create a valid post name. Drafts are allowed to have an empty
// post name.

View File

@ -2022,7 +2022,7 @@ function get_home_template() {
function get_page_template() {
global $wp_query;
$id = $wp_query->post->ID;
$id = (int) $wp_query->post->ID;
$template = get_post_meta($id, '_wp_page_template', true);
if ( 'default' == $template )

View File

@ -466,7 +466,7 @@ endif;
if ( !function_exists('wp_verify_nonce') ) :
function wp_verify_nonce($nonce, $action = -1) {
$user = wp_get_current_user();
$uid = $user->id;
$uid = (int) $user->id;
$i = ceil(time() / 43200);
@ -480,7 +480,7 @@ endif;
if ( !function_exists('wp_create_nonce') ) :
function wp_create_nonce($action = -1) {
$user = wp_get_current_user();
$uid = $user->id;
$uid = (int) $user->id;
$i = ceil(time() / 43200);

View File

@ -77,7 +77,7 @@ function wp_insert_user($userdata) {
$query = "UPDATE $wpdb->users SET user_pass='$user_pass', user_email='$user_email', user_url='$user_url', user_nicename = '$user_nicename', display_name = '$display_name' WHERE ID = '$ID'";
$query = apply_filters('update_user_query', $query);
$wpdb->query( $query );
$user_id = $ID;
$user_id = (int) $ID;
} else {
$query = "INSERT INTO $wpdb->users
(user_login, user_pass, user_email, user_url, user_registered, user_nicename, display_name)
@ -85,7 +85,7 @@ function wp_insert_user($userdata) {
('$user_login', '$user_pass', '$user_email', '$user_url', '$user_registered', '$user_nicename', '$display_name')";
$query = apply_filters('create_user_query', $query);
$wpdb->query( $query );
$user_id = $wpdb->insert_id;
$user_id = (int) $wpdb->insert_id;
}
update_usermeta( $user_id, 'first_name', $first_name);

View File

@ -136,7 +136,7 @@ function the_author_posts_link($deprecated = '') {
function get_author_link($echo = false, $author_id, $author_nicename = '') {
global $wpdb, $wp_rewrite, $post, $cache_userdata;
$auth_ID = $author_id;
$auth_ID = (int) $author_id;
$link = $wp_rewrite->get_author_permastruct();
if ( empty($link) ) {

View File

@ -5,7 +5,7 @@ global $post, $category_cache;
$id = (int) $id;
if ( !$id )
$id = $post->ID;
$id = (int) $post->ID;
if ( !isset($category_cache[$id]) )
update_post_category_cache($id);

View File

@ -89,7 +89,7 @@ function get_page_link($id = false) {
$id = (int) $id;
if ( !$id )
$id = $post->ID;
$id = (int) $post->ID;
$pagestruct = $wp_rewrite->get_page_permastruct();
@ -110,7 +110,7 @@ function get_attachment_link($id = false) {
$link = false;
if (! $id) {
$id = $post->ID;
$id = (int) $post->ID;
}
$object = get_post($id);