mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 07:07:38 +02:00
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:
parent
a359d5977b
commit
bb07c58477
@ -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')
|
('$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) {
|
if ( $comment_approved == 1) {
|
||||||
$count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND 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;
|
$post_id = (int) $post_id;
|
||||||
|
|
||||||
if ( !$post_id )
|
if ( !$post_id )
|
||||||
$post_id = $id;
|
$post_id = (int) $id;
|
||||||
|
|
||||||
if ( !isset($comment_count_cache[$post_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'");
|
$comment_count_cache[$id] = $wpdb->get_var("SELECT comment_count FROM $wpdb->posts WHERE ID = '$post_id'");
|
||||||
|
@ -47,7 +47,7 @@ function wp_insert_post($postarr = array()) {
|
|||||||
|
|
||||||
// Get the post ID.
|
// Get the post ID.
|
||||||
if ( $update )
|
if ( $update )
|
||||||
$post_ID = $ID;
|
$post_ID = (int) $ID;
|
||||||
|
|
||||||
// Create a valid post name. Drafts are allowed to have an empty
|
// Create a valid post name. Drafts are allowed to have an empty
|
||||||
// post name.
|
// post name.
|
||||||
|
@ -2022,7 +2022,7 @@ function get_home_template() {
|
|||||||
function get_page_template() {
|
function get_page_template() {
|
||||||
global $wp_query;
|
global $wp_query;
|
||||||
|
|
||||||
$id = $wp_query->post->ID;
|
$id = (int) $wp_query->post->ID;
|
||||||
$template = get_post_meta($id, '_wp_page_template', true);
|
$template = get_post_meta($id, '_wp_page_template', true);
|
||||||
|
|
||||||
if ( 'default' == $template )
|
if ( 'default' == $template )
|
||||||
|
@ -466,7 +466,7 @@ endif;
|
|||||||
if ( !function_exists('wp_verify_nonce') ) :
|
if ( !function_exists('wp_verify_nonce') ) :
|
||||||
function wp_verify_nonce($nonce, $action = -1) {
|
function wp_verify_nonce($nonce, $action = -1) {
|
||||||
$user = wp_get_current_user();
|
$user = wp_get_current_user();
|
||||||
$uid = $user->id;
|
$uid = (int) $user->id;
|
||||||
|
|
||||||
$i = ceil(time() / 43200);
|
$i = ceil(time() / 43200);
|
||||||
|
|
||||||
@ -480,7 +480,7 @@ endif;
|
|||||||
if ( !function_exists('wp_create_nonce') ) :
|
if ( !function_exists('wp_create_nonce') ) :
|
||||||
function wp_create_nonce($action = -1) {
|
function wp_create_nonce($action = -1) {
|
||||||
$user = wp_get_current_user();
|
$user = wp_get_current_user();
|
||||||
$uid = $user->id;
|
$uid = (int) $user->id;
|
||||||
|
|
||||||
$i = ceil(time() / 43200);
|
$i = ceil(time() / 43200);
|
||||||
|
|
||||||
|
@ -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 = "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);
|
$query = apply_filters('update_user_query', $query);
|
||||||
$wpdb->query( $query );
|
$wpdb->query( $query );
|
||||||
$user_id = $ID;
|
$user_id = (int) $ID;
|
||||||
} else {
|
} else {
|
||||||
$query = "INSERT INTO $wpdb->users
|
$query = "INSERT INTO $wpdb->users
|
||||||
(user_login, user_pass, user_email, user_url, user_registered, user_nicename, display_name)
|
(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')";
|
('$user_login', '$user_pass', '$user_email', '$user_url', '$user_registered', '$user_nicename', '$display_name')";
|
||||||
$query = apply_filters('create_user_query', $query);
|
$query = apply_filters('create_user_query', $query);
|
||||||
$wpdb->query( $query );
|
$wpdb->query( $query );
|
||||||
$user_id = $wpdb->insert_id;
|
$user_id = (int) $wpdb->insert_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
update_usermeta( $user_id, 'first_name', $first_name);
|
update_usermeta( $user_id, 'first_name', $first_name);
|
||||||
|
@ -136,7 +136,7 @@ function the_author_posts_link($deprecated = '') {
|
|||||||
|
|
||||||
function get_author_link($echo = false, $author_id, $author_nicename = '') {
|
function get_author_link($echo = false, $author_id, $author_nicename = '') {
|
||||||
global $wpdb, $wp_rewrite, $post, $cache_userdata;
|
global $wpdb, $wp_rewrite, $post, $cache_userdata;
|
||||||
$auth_ID = $author_id;
|
$auth_ID = (int) $author_id;
|
||||||
$link = $wp_rewrite->get_author_permastruct();
|
$link = $wp_rewrite->get_author_permastruct();
|
||||||
|
|
||||||
if ( empty($link) ) {
|
if ( empty($link) ) {
|
||||||
|
@ -5,7 +5,7 @@ global $post, $category_cache;
|
|||||||
|
|
||||||
$id = (int) $id;
|
$id = (int) $id;
|
||||||
if ( !$id )
|
if ( !$id )
|
||||||
$id = $post->ID;
|
$id = (int) $post->ID;
|
||||||
|
|
||||||
if ( !isset($category_cache[$id]) )
|
if ( !isset($category_cache[$id]) )
|
||||||
update_post_category_cache($id);
|
update_post_category_cache($id);
|
||||||
|
@ -89,7 +89,7 @@ function get_page_link($id = false) {
|
|||||||
|
|
||||||
$id = (int) $id;
|
$id = (int) $id;
|
||||||
if ( !$id )
|
if ( !$id )
|
||||||
$id = $post->ID;
|
$id = (int) $post->ID;
|
||||||
|
|
||||||
$pagestruct = $wp_rewrite->get_page_permastruct();
|
$pagestruct = $wp_rewrite->get_page_permastruct();
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ function get_attachment_link($id = false) {
|
|||||||
$link = false;
|
$link = false;
|
||||||
|
|
||||||
if (! $id) {
|
if (! $id) {
|
||||||
$id = $post->ID;
|
$id = (int) $post->ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
$object = get_post($id);
|
$object = get_post($id);
|
||||||
|
Loading…
Reference in New Issue
Block a user