Changeset 5087
- Timestamp:
- 03/23/2007 12:59:21 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/app.php
r5000 r5087 418 418 $this->auth_required('Sorry, you do not have the right to edit/publish new posts.'); 419 419 420 $blog_ID = $current_blog->blog_id;420 $blog_ID = (int )$current_blog->blog_id; 421 421 $post_status = ($publish) ? 'publish' : 'draft'; 422 $post_author = $user->ID;422 $post_author = (int) $user->ID; 423 423 $post_title = $entry->title; 424 424 $post_content = $entry->content; … … 431 431 log_app('Inserting Post. Data:', print_r($post_data,true)); 432 432 433 $postID = wp_insert_post($post_data);433 $postID = (int) wp_insert_post($post_data); 434 434 435 435 if (!$postID) { … … 583 583 584 584 // Save the data 585 $postID = wp_insert_attachment($attachment, $file, $post);585 $postID = (int) wp_insert_attachment($attachment, $file, $post); 586 586 587 587 if (!$postID) { … … 789 789 if(!isset($postID)) { 790 790 global $post; 791 $postID = $GLOBALS['post']->ID;791 $postID = (int) $GLOBALS['post']->ID; 792 792 } 793 793 … … 811 811 if(!isset($postID)) { 812 812 global $post; 813 $postID = $GLOBALS['post']->ID;813 $postID = (int) $GLOBALS['post']->ID; 814 814 } 815 815 … … 886 886 $wp_query = $GLOBALS['wp_query']; 887 887 $wpdb = $GLOBALS['wpdb']; 888 $blog_id = $GLOBALS['blog_id'];888 $blog_id = (int) $GLOBALS['blog_id']; 889 889 $post_cache = $GLOBALS['post_cache']; 890 890 -
trunk/wp-admin/admin-ajax.php
r4953 r5087 116 116 if ( !$category_nicename = sanitize_title($cat_name) ) 117 117 die('0'); 118 if ( !$cat_id = category_exists( $cat_name ) )119 $cat_id = wp_create_category( $cat_name );118 if ( !$cat_id = (int) category_exists( $cat_name ) ) 119 $cat_id = (int) wp_create_category( $cat_name ); 120 120 $cat_name = wp_specialchars(stripslashes($cat_name)); 121 121 $x->add( array( … … 157 157 if ( $id < 0 ) { 158 158 $now = current_time('timestamp', 1); 159 if ( $pid = wp_insert_post( array(159 if ( $pid = (int) wp_insert_post( array( 160 160 'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) 161 161 ) ) ) 162 $mid = add_meta( $pid );162 $mid = (int) add_meta( $pid ); 163 163 else 164 164 die('0'); 165 } else if ( !$mid = add_meta( $id ) ) {165 } else if ( !$mid = (int) add_meta( $id ) ) { 166 166 die('0'); 167 167 } … … 205 205 die('-1'); 206 206 require_once(ABSPATH . WPINC . '/registration.php'); 207 if ( !$user_id = add_user() )207 if ( !$user_id = (int) add_user() ) 208 208 die('0'); 209 209 elseif ( is_wp_error( $user_id ) ) { … … 231 231 if($_POST['post_ID'] < 0) { 232 232 $_POST['temp_ID'] = $_POST['post_ID']; 233 $id = wp_write_post();233 $id = (int) wp_write_post(); 234 234 if(is_wp_error($id)) 235 235 die($id->get_error_message()); -
trunk/wp-admin/admin-db.php
r5029 r5087 124 124 if (!$update) { 125 125 $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent, links_private, posts_private) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent', '$links_private', '$posts_private')"); 126 $cat_ID = $wpdb->insert_id;126 $cat_ID = (int) $wpdb->insert_id; 127 127 } else { 128 128 $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent', links_private = '$links_private', posts_private = '$posts_private' WHERE cat_ID = '$cat_ID'"); … … 361 361 } else { 362 362 $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')"); 363 $link_id = $wpdb->insert_id;363 $link_id = (int) $wpdb->insert_id; 364 364 } 365 365 -
trunk/wp-admin/admin-functions.php
r5072 r5087 115 115 if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) 116 116 $draft_ids = array(); 117 if ( $draft_temp_id = array_search( $post_ID, $draft_ids ) )117 if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) 118 118 relocate_children( $draft_temp_id, $post_ID ); 119 119 if ( $temp_id && $temp_id != $draft_temp_id ) … … 158 158 continue; 159 159 160 $id = $id_matches[3];160 $id = (int) $id_matches[3]; 161 161 162 162 // While we have the attachment ID, let's adopt any orphans. … … 291 291 if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) 292 292 $draft_ids = array(); 293 if ( $draft_temp_id = array_search( $post_ID, $draft_ids ) )293 if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) 294 294 relocate_children( $draft_temp_id, $post_ID ); 295 295 … … 448 448 if ( func_num_args() ) { // The hackiest hack that ever did hack 449 449 global $current_user, $wp_roles; 450 $user_id = func_get_arg( 0 );450 $user_id = (int) func_get_arg( 0 ); 451 451 452 452 if ( isset( $_POST['role'] ) ) { … … 466 466 if ( $user_id != 0 ) { 467 467 $update = true; 468 $user->ID = $user_id;468 $user->ID = (int) $user_id; 469 469 $userdata = get_userdata( $user_id ); 470 470 $user->user_login = $wpdb->escape( $userdata->user_login ); … … 563 563 564 564 if ( $update ) { 565 $user_id = wp_update_user( get_object_vars( $user ));566 } else { 567 $user_id = wp_insert_user( get_object_vars( $user ));565 $user_id = (int) wp_update_user( get_object_vars( $user )); 566 } else { 567 $user_id = (int) wp_insert_user( get_object_vars( $user )); 568 568 wp_new_user_notification( $user_id ); 569 569 } … … 794 794 if ( current_user_can( 'manage_categories' ) ) { 795 795 $edit = "<a href='categories.php?action=edit&cat_ID=$category->cat_ID' class='edit'>".__( 'Edit' )."</a></td>"; 796 $default_cat_id = get_option( 'default_category' );797 $default_link_cat_id = get_option( 'default_link_category' );796 $default_cat_id = (int) get_option( 'default_category' ); 797 $default_link_cat_id = (int) get_option( 'default_link_category' ); 798 798 799 799 if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) ) … … 834 834 $post->post_title = wp_specialchars( $post->post_title ); 835 835 $pad = str_repeat( '— ', $level ); 836 $id = $post->ID;836 $id = (int) $post->ID; 837 837 $class = ('alternate' == $class ) ? '' : 'alternate'; 838 838 ?> … … 1970 1970 1971 1971 // Save the data 1972 $id = wp_insert_attachment( $object, $file );1972 $id = (int) wp_insert_attachment( $object, $file ); 1973 1973 1974 1974 return array( 'file' => $file, 'id' => $id ); -
trunk/wp-admin/custom-header.php
r5007 r5087 216 216 217 217 // Save the data 218 $id = wp_insert_attachment($object, $file);218 $id = (int) wp_insert_attachment($object, $file); 219 219 220 220 $upload = array('file' => $file, 'id' => $id); -
trunk/wp-admin/edit-comments.php
r5056 r5087 57 57 foreach ($_POST['delete_comments'] as $comment) : // Check the permissions on each 58 58 $comment = (int) $comment; 59 $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");59 $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); 60 60 // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); 61 61 if ( current_user_can('edit_post', $post_id) ) { -
trunk/wp-admin/import/blogger.php
r5038 r5087 547 547 } 548 548 549 $comment_post_ID = $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink];549 $comment_post_ID = (int) $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink]; 550 550 preg_match('#<name>(.+?)</name>.*(?:\<uri>(.+?)</uri>)?#', $entry->author, $matches); 551 551 $comment_author = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) ); -
trunk/wp-admin/import/blogware.php
r4495 r5087 105 105 106 106 if ( $comments ) { 107 $comment_post_ID = $post_id;107 $comment_post_ID = (int) $post_id; 108 108 $num_comments = 0; 109 109 foreach ($comments as $comment) { -
trunk/wp-admin/import/dotclear.php
r4608 r5087 438 438 439 439 // WordPressify Data 440 $comment_ID = ltrim($comment_id, '0');441 $comment_post_ID = $postarr[$post_id];440 $comment_ID = (int) ltrim($comment_id, '0'); 441 $comment_post_ID = (int) $postarr[$post_id]; 442 442 $comment_approved = "$comment_pub"; 443 443 $name = $wpdb->escape(csc ($comment_auteur)); -
trunk/wp-admin/import/livejournal.php
r4608 r5087 83 83 84 84 if ( $comments ) { 85 $comment_post_ID = $post_id;85 $comment_post_ID = (int) $post_id; 86 86 $num_comments = 0; 87 87 foreach ($comments as $comment) { -
trunk/wp-admin/import/mt.php
r4608 r5087 172 172 } 173 173 $this->file = $file['file']; 174 $this->id = $file['id'];174 $this->id = (int) $file['id']; 175 175 176 176 $this->get_entries(); … … 296 296 } 297 297 298 $comment_post_ID = $post_id;298 $comment_post_ID = (int) $post_id; 299 299 $comment_approved = 1; 300 300 -
trunk/wp-admin/import/wordpress.php
r4742 r5087 175 175 } 176 176 $this->file = $file['file']; 177 $this->id = $file['id'];177 $this->id = (int) $file['id']; 178 178 179 179 $this->get_entries(); -
trunk/wp-comments-post.php
r5039 r5087 55 55 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID'); 56 56 57 $comment_id = wp_new_comment( $commentdata );57 $comment_id = (int) wp_new_comment( $commentdata ); 58 58 59 59 $comment = get_comment($comment_id); -
trunk/wp-includes/author-template.php
r4656 r5087 145 145 function get_author_posts_url($author_id, $author_nicename = '') { 146 146 global $wpdb, $wp_rewrite, $post, $cache_userdata; 147 $auth_ID = $author_id;147 $auth_ID = (int) $author_id; 148 148 $link = $wp_rewrite->get_author_permastruct(); 149 149 -
trunk/wp-includes/bookmark-template.php
r5056 r5087 166 166 return ''; 167 167 168 $cat_id = $cats[0]; // Take the first cat. 168 $cat_id = (int) 169 $cats[0]; // Take the first cat. 169 170 170 171 $cat = get_category($cat_id); -
trunk/wp-includes/category-template.php
r5082 r5087 65 65 $id = (int) $id; 66 66 if ( !$id ) 67 $id = $post->ID; 67 $id = (int) 68 $post->ID; 68 69 69 70 if ( !isset($category_cache[$blog_id][$id]) ) -
trunk/wp-includes/comment-template.php
r5039 r5087 151 151 152 152 if ( !$post_id ) 153 $post_id = $id;153 $post_id = (int) $id; 154 154 155 155 $post = get_post($post_id); -
trunk/wp-includes/comment.php
r5056 r5087 346 346 "); 347 347 348 $id = $wpdb->insert_id;348 $id = (int) $wpdb->insert_id; 349 349 350 350 if ( $comment_approved == 1) … … 393 393 $commentdata['comment_approved'] = wp_allow_comment($commentdata); 394 394 395 $comment_ID = wp_insert_comment($commentdata);395 $comment_ID = (int) wp_insert_comment($commentdata); 396 396 397 397 do_action('comment_post', $comment_ID, $commentdata['comment_approved']); -
trunk/wp-includes/feed.php
r5019 r5087 107 107 108 108 function get_author_rss_link($echo = false, $author_id, $author_nicename) { 109 $auth_ID = $author_id;109 $auth_ID = (int) $author_id; 110 110 $permalink_structure = get_option('permalink_structure'); 111 111 -
trunk/wp-includes/functions.php
r5056 r5087 647 647 $count = count( $post_id_array); 648 648 for ( $i = 0; $i < $count; $i++ ) { 649 $post_id = $post_id_array[ $i ];649 $post_id = (int) $post_id_array[ $i ]; 650 650 if ( isset( $category_cache[$blog_id][$post_id] ) ) { 651 651 unset( $post_id_array[ $i ] ); … … 701 701 $count = count( $post_id_array); 702 702 for ( $i = 0; $i < $count; $i++ ) { 703 $post_id = $post_id_array[ $i ];703 $post_id = (int) $post_id_array[ $i ]; 704 704 if ( isset( $post_meta_cache[$blog_id][$post_id] ) ) { // If the meta is already cached 705 705 unset( $post_id_array[ $i ] ); -
trunk/wp-includes/link-template.php
r5078 r5087 120 120 $id = (int) $id; 121 121 if ( !$id ) 122 $id = $post->ID;122 $id = (int) $post->ID; 123 123 124 124 if ( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) … … 135 135 136 136 if ( !$id ) 137 $id = $post->ID;137 $id = (int) $post->ID; 138 138 139 139 $pagestruct = $wp_rewrite->get_page_permastruct(); … … 157 157 158 158 if (! $id) { 159 $id = $post->ID;159 $id = (int) $post->ID; 160 160 } 161 161 … … 260 260 261 261 if ( empty($post_id) ) 262 $post_id = $id;262 $post_id = (int) $id; 263 263 264 264 if ( '' != get_option('permalink_structure') ) { -
trunk/wp-includes/pluggable.php
r5061 r5087 526 526 function wp_verify_nonce($nonce, $action = -1) { 527 527 $user = wp_get_current_user(); 528 $uid = $user->id;528 $uid = (int) $user->id; 529 529 530 530 $i = ceil(time() / 43200); … … 540 540 function wp_create_nonce($action = -1) { 541 541 $user = wp_get_current_user(); 542 $uid = $user->id;542 $uid = (int) $user->id; 543 543 544 544 $i = ceil(time() / 43200); -
trunk/wp-includes/post.php
r5086 r5087 376 376 377 377 if ( !$post_id ) 378 $post_id = $id;378 $post_id = (int) $id; 379 379 380 380 $post_id = (int) $post_id; … … 540 540 // Get the post ID. 541 541 if ( $update ) 542 $post_ID = $ID;542 $post_ID = (int) $ID; 543 543 544 544 // Create a valid post name. Drafts are allowed to have an empty … … 1257 1257 if ( !empty($ID) ) { 1258 1258 $update = true; 1259 $post_ID = $ID;1259 $post_ID = (int) $ID; 1260 1260 } 1261 1261 … … 1507 1507 if ( !$post =& get_post( $mime ) ) 1508 1508 return false; 1509 $post_id = $post->ID;1509 $post_id = (int) $post->ID; 1510 1510 $mime = $post->post_mime_type; 1511 1511 } -
trunk/wp-includes/query.php
r5002 r5087 588 588 $this->queried_object =& get_page_by_path($qv['pagename']); 589 589 if ( !empty($this->queried_object) ) 590 $this->queried_object_id = $this->queried_object->ID;590 $this->queried_object_id = (int) $this->queried_object->ID; 591 591 else 592 592 unset($this->queried_object); … … 1206 1206 $category = &get_category($cat); 1207 1207 $this->queried_object = &$category; 1208 $this->queried_object_id = $cat;1208 $this->queried_object_id = (int) $cat; 1209 1209 } else if ($this->is_posts_page) { 1210 1210 $this->queried_object = & get_page(get_option('page_for_posts')); 1211 $this->queried_object_id = $this->queried_object->ID;1211 $this->queried_object_id = (int) $this->queried_object->ID; 1212 1212 } else if ($this->is_single) { 1213 1213 $this->queried_object = $this->post; 1214 $this->queried_object_id = $this->post->ID;1214 $this->queried_object_id = (int) $this->post->ID; 1215 1215 } else if ($this->is_page) { 1216 1216 $this->queried_object = $this->post; 1217 $this->queried_object_id = $this->post->ID;1217 $this->queried_object_id = (int) $this->post->ID; 1218 1218 } else if ($this->is_author) { 1219 $author_id = $this->get('author');1219 $author_id = (int) $this->get('author'); 1220 1220 $author = get_userdata($author_id); 1221 1221 $this->queried_object = $author; … … 1286 1286 global $pagenow; 1287 1287 1288 $id = $post->ID;1288 $id = (int) $post->ID; 1289 1289 1290 1290 $authordata = get_userdata($post->post_author); -
trunk/wp-includes/registration.php
r4651 r5087 90 90 $query = apply_filters('update_user_query', $query); 91 91 $wpdb->query( $query ); 92 $user_id = $ID;92 $user_id = (int) $ID; 93 93 } else { 94 94 $query = "INSERT INTO $wpdb->users … … 98 98 $query = apply_filters('create_user_query', $query); 99 99 $wpdb->query( $query ); 100 $user_id = $wpdb->insert_id;100 $user_id = (int) $wpdb->insert_id; 101 101 } 102 102 -
trunk/wp-includes/theme.php
r5028 r5087 347 347 global $wp_query; 348 348 349 $id = $wp_query->post->ID;349 $id = (int) $wp_query->post->ID; 350 350 $template = get_post_meta($id, '_wp_page_template', true); 351 351 -
trunk/wp-includes/user.php
r5037 r5087 57 57 global $wpdb, $blog_id; 58 58 if ( empty($id) ) 59 $id = $blog_id;59 $id = (int) $blog_id; 60 60 $users = $wpdb->get_results( "SELECT user_id, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE " . $wpdb->users . ".ID = " . $wpdb->usermeta . ".user_id AND meta_key = '" . $wpdb->prefix . "capabilities' ORDER BY {$wpdb->usermeta}.user_id" ); 61 61 return $users; … … 172 172 $userdata = $user->data; 173 173 $user_login = $user->user_login; 174 $user_level = $user->user_level;175 $user_ID = $user->ID;174 $user_level = (int) $user->user_level; 175 $user_ID = (int) $user->ID; 176 176 $user_email = $user->user_email; 177 177 $user_url = $user->user_url; -
trunk/wp-login.php
r5064 r5087 243 243 $user_pass = substr( md5( uniqid( microtime() ) ), 0, 7); 244 244 245 $user_id = wp_create_user( $user_login, $user_pass, $user_email );245 $user_id = (int) wp_create_user( $user_login, $user_pass, $user_email ); 246 246 if ( !$user_id ) 247 247 $errors['registerfail'] = sprintf(__('<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_option('admin_email')); -
trunk/wp-mail.php
r4144 r5087 137 137 $post_data = add_magic_quotes($post_data); 138 138 139 $post_ID = wp_insert_post($post_data);139 $post_ID = (int) wp_insert_post($post_data); 140 140 141 141 if (!$post_ID) { -
trunk/wp-trackback.php
r4801 r5087 85 85 } 86 86 87 $comment_post_ID = $tb_id;87 $comment_post_ID = (int) $tb_id; 88 88 $comment_author = $blog_name; 89 89 $comment_author_email = ''; -
trunk/xmlrpc.php
r5082 r5087 173 173 $this->escape($args); 174 174 175 $blog_id = $args[0];176 $page_id = $args[1];175 $blog_id = (int) $args[0]; 176 $page_id = (int) $args[1]; 177 177 $username = $args[2]; 178 178 $password = $args[3]; … … 253 253 $this->escape($args); 254 254 255 $blog_id = $args[0];255 $blog_id = (int) $args[0]; 256 256 $username = $args[1]; 257 257 $password = $args[2]; … … 321 321 $this->escape($args); 322 322 323 $blog_id = $args[0];323 $blog_id = (int) $args[0]; 324 324 $username = $args[1]; 325 325 $password = $args[2]; 326 $page_id = $args[3];326 $page_id = (int) $args[3]; 327 327 328 328 if(!$this->login_pass_ok($username, $password)) { … … 361 361 function wp_editPage($args) { 362 362 // Items not escaped here will be escaped in editPost. 363 $blog_id = $args[0];363 $blog_id = (int) $args[0]; 364 364 $page_id = $this->escape((int) $args[1]); 365 365 $username = $this->escape($args[2]); … … 412 412 $this->escape($args); 413 413 414 $blog_id = $args[0];414 $blog_id = (int) $args[0]; 415 415 $username = $args[1]; 416 416 $password = $args[2]; … … 452 452 $this->escape($args); 453 453 454 $blog_id = $args[0];454 $blog_id = (int) $args[0]; 455 455 $username = $args[1]; 456 456 $password = $args[2]; … … 470 470 $this->escape($args); 471 471 472 $blog_id = $args[0];472 $blog_id = (int) $args[0]; 473 473 $username = $args[1]; 474 474 $password = $args[2]; … … 513 513 ); 514 514 515 $cat_id = wp_insert_category($new_category);515 $cat_id = (int) wp_insert_category($new_category); 516 516 if(!$cat_id) { 517 517 return(new IXR_Error(500, "Sorry, the new category failed.")); … … 530 530 $this->escape($args); 531 531 532 $blog_id = $args[0];532 $blog_id = (int) $args[0]; 533 533 $username = $args[1]; 534 534 $password = $args[2]; … … 621 621 $this->escape($args); 622 622 623 $post_ID = $args[1];623 $post_ID = (int) $args[1]; 624 624 $user_login = $args[2]; 625 625 $user_pass = $args[3]; … … 656 656 $this->escape($args); 657 657 658 $blog_ID = $args[1]; /* though we don't use it yet */658 $blog_ID = (int) $args[1]; /* though we don't use it yet */ 659 659 $user_login = $args[2]; 660 660 $user_pass = $args[3]; … … 704 704 $this->escape($args); 705 705 706 $blog_ID = $args[1];706 $blog_ID = (int) $args[1]; 707 707 $user_login = $args[2]; 708 708 $user_pass = $args[3]; … … 738 738 $this->escape($args); 739 739 740 $blog_ID = $args[1];740 $blog_ID = (int) $args[1]; 741 741 $user_login = $args[2]; 742 742 $user_pass = $args[3]; … … 775 775 $this->escape($args); 776 776 777 $blog_ID = $args[1]; /* though we don't use it yet */777 $blog_ID = (int) $args[1]; /* though we don't use it yet */ 778 778 $user_login = $args[2]; 779 779 $user_pass = $args[3]; … … 803 803 $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status'); 804 804 805 $post_ID = wp_insert_post($post_data);805 $post_ID = (int) wp_insert_post($post_data); 806 806 807 807 if (!$post_ID) { … … 874 874 $this->escape($args); 875 875 876 $post_ID = $args[1];876 $post_ID = (int) $args[1]; 877 877 $user_login = $args[2]; 878 878 $user_pass = $args[3]; … … 915 915 $this->escape($args); 916 916 917 $blog_ID = $args[0]; // we will support this in the near future917 $blog_ID = (int) $args[0]; // we will support this in the near future 918 918 $user_login = $args[1]; 919 919 $user_pass = $args[2]; … … 1031 1031 $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order'); 1032 1032 1033 $post_ID = wp_insert_post($postdata);1033 $post_ID = (int) wp_insert_post($postdata); 1034 1034 1035 1035 if (!$post_ID) { … … 1217 1217 $this->escape($args); 1218 1218 1219 $post_ID = $args[0];1219 $post_ID = (int) $args[0]; 1220 1220 $user_login = $args[1]; 1221 1221 $user_pass = $args[2]; … … 1279 1279 $this->escape($args); 1280 1280 1281 $blog_ID = $args[0];1281 $blog_ID = (int) $args[0]; 1282 1282 $user_login = $args[1]; 1283 1283 $user_pass = $args[2]; 1284 $num_posts = $args[3];1284 $num_posts = (int) $args[3]; 1285 1285 1286 1286 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 1352 1352 $this->escape($args); 1353 1353 1354 $blog_ID = $args[0];1354 $blog_ID = (int) $args[0]; 1355 1355 $user_login = $args[1]; 1356 1356 $user_pass = $args[2]; … … 1387 1387 global $wpdb; 1388 1388 1389 $blog_ID = $wpdb->escape($args[0]);1389 $blog_ID = (int) $args[0]; 1390 1390 $user_login = $wpdb->escape($args[1]); 1391 1391 $user_pass = $wpdb->escape($args[2]); … … 1448 1448 1449 1449 // Save the data 1450 $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id );1450 $id = (int) wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); 1451 1451 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); 1452 1452 … … 1464 1464 $this->escape($args); 1465 1465 1466 $blog_ID = $args[0];1466 $blog_ID = (int) $args[0]; 1467 1467 $user_login = $args[1]; 1468 1468 $user_pass = $args[2]; 1469 $num_posts = $args[3];1469 $num_posts = (int) $args[3]; 1470 1470 1471 1471 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 1509 1509 $this->escape($args); 1510 1510 1511 $blog_ID = $args[0];1511 $blog_ID = (int) $args[0]; 1512 1512 $user_login = $args[1]; 1513 1513 $user_pass = $args[2]; … … 1538 1538 $this->escape($args); 1539 1539 1540 $post_ID = $args[0];1540 $post_ID = (int) $args[0]; 1541 1541 $user_login = $args[1]; 1542 1542 $user_pass = $args[2]; … … 1568 1568 $this->escape($args); 1569 1569 1570 $post_ID = $args[0];1570 $post_ID = (int) $args[0]; 1571 1571 $user_login = $args[1]; 1572 1572 $user_pass = $args[2]; … … 1651 1651 $this->escape($args); 1652 1652 1653 $post_ID = $args[0];1653 $post_ID = (int) $args[0]; 1654 1654 $user_login = $args[1]; 1655 1655 $user_pass = $args[2]; … … 1713 1713 // the path defines the post_ID (archives/p/XXXX) 1714 1714 $blah = explode('/', $match[0]); 1715 $post_ID = $blah[1];1715 $post_ID = (int) $blah[1]; 1716 1716 $way = 'from the path'; 1717 1717 } elseif (preg_match('#p=[0-9]{1,}#', $urltest['query'], $match)) { 1718 1718 // the querystring defines the post_ID (?p=XXXX) 1719 1719 $blah = explode('=', $match[0]); 1720 $post_ID = $blah[1];1720 $post_ID = (int) $blah[1]; 1721 1721 $way = 'from the querystring'; 1722 1722 } elseif (isset($urltest['fragment'])) { … … 1724 1724 if (intval($urltest['fragment'])) { 1725 1725 // ...an integer #XXXX (simpliest case) 1726 $post_ID = $urltest['fragment'];1726 $post_ID = (int) $urltest['fragment']; 1727 1727 $way = 'from the fragment (numeric)'; 1728 1728 } elseif (preg_match('/post-[0-9]+/',$urltest['fragment'])) { … … 1838 1838 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type'); 1839 1839 1840 $comment_ID = wp_new_comment($commentdata);1840 $comment_ID = (int) wp_new_comment($commentdata); 1841 1841 do_action('pingback_post', $comment_ID); 1842 1842 … … 1856 1856 $url = $args; 1857 1857 1858 $post_ID = url_to_postid($url);1858 $post_ID = (int) url_to_postid($url); 1859 1859 if (!$post_ID) { 1860 1860 // We aren't sure that the resource is available and/or pingback enabled
Note: See TracChangeset
for help on using the changeset viewer.