From 77559c20b467a94ee8958a1edd2f749c4eea84af Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 22 Mar 2007 20:52:29 +0000 Subject: [PATCH] More int casts git-svn-id: https://develop.svn.wordpress.org/trunk@5082 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category-template.php | 1 + wp-includes/post.php | 4 ++++ xmlrpc.php | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 2e61e3e392..236327ed0e 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -62,6 +62,7 @@ function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = function get_the_category($id = false) { global $post, $category_cache, $blog_id; + $id = (int) $id; if ( !$id ) $id = $post->ID; diff --git a/wp-includes/post.php b/wp-includes/post.php index 1e155066ba..aa5b7ef917 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -447,6 +447,8 @@ function wp_delete_post($postid = 0) { } function wp_get_post_categories($post_id = 0) { + $post_id = (int) $post_id; + $cats = &get_the_category($post_id); $cat_ids = array(); foreach ( $cats as $cat ) @@ -471,6 +473,8 @@ function wp_get_recent_posts($num = 10) { function wp_get_single_post($postid = 0, $mode = OBJECT) { global $wpdb; + $postid = (int) $postid; + $post = get_post($postid, $mode); // Set categories diff --git a/xmlrpc.php b/xmlrpc.php index 9126a8cfea..f88b2aa084 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -361,7 +361,7 @@ class wp_xmlrpc_server extends IXR_Server { function wp_editPage($args) { // Items not escaped here will be escaped in editPost. $blog_id = $args[0]; - $page_id = $this->escape($args[1]); + $page_id = $this->escape((int) $args[1]); $username = $this->escape($args[2]); $password = $this->escape($args[3]); $content = $args[4]; @@ -822,7 +822,7 @@ class wp_xmlrpc_server extends IXR_Server { $this->escape($args); - $post_ID = $args[1]; + $post_ID = (int) $args[1]; $user_login = $args[2]; $user_pass = $args[3]; $content = $args[4]; @@ -1064,7 +1064,7 @@ class wp_xmlrpc_server extends IXR_Server { $this->escape($args); - $post_ID = $args[0]; + $post_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; $content_struct = $args[3];