Changeset 5099
- Timestamp:
- 03/25/2007 11:06:28 PM (19 years ago)
- Location:
- branches/2.0
- Files:
-
- 7 edited
-
wp-admin/admin-db.php (modified) (4 diffs)
-
wp-admin/edit-comments.php (modified) (1 diff)
-
wp-admin/import/dotclear.php (modified) (1 diff)
-
wp-admin/import/livejournal.php (modified) (1 diff)
-
wp-admin/import/mt.php (modified) (2 diffs)
-
wp-trackback.php (modified) (1 diff)
-
xmlrpc.php (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-admin/admin-db.php
r4365 r5099 111 111 if (!$update) { 112 112 $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent')"); 113 $cat_ID = $wpdb->insert_id;113 $cat_ID = (int) $wpdb->insert_id; 114 114 } else { 115 115 $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'"); … … 208 208 return 0; 209 209 210 return $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'");210 return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'"); 211 211 } 212 212 … … 270 270 if ( !empty($link_id) ) 271 271 $update = true; 272 273 $link_id = (int) $link_id; 272 274 273 275 if( trim( $link_name ) == '' ) … … 327 329 } else { 328 330 $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_category', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')"); 329 $link_id = $wpdb->insert_id;331 $link_id = (int) $wpdb->insert_id; 330 332 } 331 333 -
branches/2.0/wp-admin/edit-comments.php
r4656 r5099 45 45 foreach ($_POST['delete_comments'] as $comment) : // Check the permissions on each 46 46 $comment = (int) $comment; 47 $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");47 $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); 48 48 $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); 49 49 if ( current_user_can('edit_post', $post_id) ) : -
branches/2.0/wp-admin/import/dotclear.php
r4239 r5099 431 431 432 432 // WordPressify Data 433 $comment_ID = ltrim($comment_id, '0');434 $comment_post_ID = $postarr[$post_id];433 $comment_ID = (int) ltrim($comment_id, '0'); 434 $comment_post_ID = (int) $postarr[$post_id]; 435 435 $comment_approved = "$comment_pub"; 436 436 $name = $wpdb->escape(csc ($comment_auteur)); -
branches/2.0/wp-admin/import/livejournal.php
r4239 r5099 81 81 82 82 if ( $comments ) { 83 $comment_post_ID = $post_id;83 $comment_post_ID = (int) $post_id; 84 84 $num_comments = 0; 85 85 foreach ($comments as $comment) { -
branches/2.0/wp-admin/import/mt.php
r4239 r5099 170 170 } 171 171 $this->file = $file['file']; 172 $this->id = $file['id'];172 $this->id = (int) $file['id']; 173 173 174 174 $this->get_entries(); … … 294 294 } 295 295 296 $comment_post_ID = $post_id;296 $comment_post_ID = (int) $post_id; 297 297 $comment_approved = 1; 298 298 -
branches/2.0/wp-trackback.php
r4677 r5099 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 = ''; -
branches/2.0/xmlrpc.php
r5084 r5099 209 209 $this->escape($args); 210 210 211 $post_ID =$args[1];212 $user_login = $args[2];213 $user_pass = $args[3];211 $post_ID = (int) $args[1]; 212 $user_login = $args[2]; 213 $user_pass = $args[3]; 214 214 215 215 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 244 244 $this->escape($args); 245 245 246 $blog_ID =$args[1]; /* though we don't use it yet */247 $user_login = $args[2];248 $user_pass = $args[3];249 $num_posts = $args[4];246 $blog_ID = (int) $args[1]; /* though we don't use it yet */ 247 $user_login = $args[2]; 248 $user_pass = $args[3]; 249 $num_posts = $args[4]; 250 250 251 251 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 292 292 $this->escape($args); 293 293 294 $blog_ID = $args[1];294 $blog_ID = (int) $args[1]; 295 295 $user_login = $args[2]; 296 296 $user_pass = $args[3]; … … 326 326 $this->escape($args); 327 327 328 $blog_ID = $args[1];328 $blog_ID = (int) $args[1]; 329 329 $user_login = $args[2]; 330 330 $user_pass = $args[3]; … … 363 363 $this->escape($args); 364 364 365 $blog_ID = $args[1]; /* though we don't use it yet */365 $blog_ID = (int) $args[1]; /* though we don't use it yet */ 366 366 $user_login = $args[2]; 367 367 $user_pass = $args[3]; … … 460 460 $this->escape($args); 461 461 462 $post_ID = $args[1];462 $post_ID = (int) $args[1]; 463 463 $user_login = $args[2]; 464 464 $user_pass = $args[3]; … … 501 501 $this->escape($args); 502 502 503 $blog_ID = $args[0]; // we will support this in the near future503 $blog_ID = (int) $args[0]; // we will support this in the near future 504 504 $user_login = $args[1]; 505 505 $user_pass = $args[2]; … … 669 669 $this->escape($args); 670 670 671 $post_ID = $args[0];671 $post_ID = (int) $args[0]; 672 672 $user_login = $args[1]; 673 673 $user_pass = $args[2]; … … 724 724 $this->escape($args); 725 725 726 $blog_ID =$args[0];727 $user_login = $args[1];728 $user_pass = $args[2];729 $num_posts =$args[3];726 $blog_ID = (int) $args[0]; 727 $user_login = $args[1]; 728 $user_pass = $args[2]; 729 $num_posts = (int) $args[3]; 730 730 731 731 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 790 790 $this->escape($args); 791 791 792 $blog_ID =$args[0];793 $user_login = $args[1];794 $user_pass = $args[2];792 $blog_ID = (int) $args[0]; 793 $user_login = $args[1]; 794 $user_pass = $args[2]; 795 795 796 796 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 824 824 global $wpdb; 825 825 826 $blog_ID = $wpdb->escape($args[0]);826 $blog_ID = (int) $args[0]; 827 827 $user_login = $wpdb->escape($args[1]); 828 828 $user_pass = $wpdb->escape($args[2]); … … 864 864 $this->escape($args); 865 865 866 $blog_ID =$args[0];867 $user_login = $args[1];868 $user_pass = $args[2];869 $num_posts =$args[3];866 $blog_ID = (int) $args[0]; 867 $user_login = $args[1]; 868 $user_pass = $args[2]; 869 $num_posts = (int) $args[3]; 870 870 871 871 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 909 909 $this->escape($args); 910 910 911 $blog_ID =$args[0];912 $user_login = $args[1];913 $user_pass = $args[2];911 $blog_ID = (int) $args[0]; 912 $user_login = $args[1]; 913 $user_pass = $args[2]; 914 914 915 915 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 938 938 $this->escape($args); 939 939 940 $post_ID =$args[0];941 $user_login = $args[1];942 $user_pass = $args[2];940 $post_ID = (int) $args[0]; 941 $user_login = $args[1]; 942 $user_pass = $args[2]; 943 943 944 944 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 968 968 $this->escape($args); 969 969 970 $post_ID =$args[0];971 $user_login = $args[1];972 $user_pass = $args[2];973 $categories = $args[3];970 $post_ID = (int) $args[0]; 971 $user_login = $args[1]; 972 $user_pass = $args[2]; 973 $categories = $args[3]; 974 974 975 975 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 1051 1051 $this->escape($args); 1052 1052 1053 $post_ID =$args[0];1054 $user_login = $args[1];1055 $user_pass = $args[2];1053 $post_ID = (int) $args[0]; 1054 $user_login = $args[1]; 1055 $user_pass = $args[2]; 1056 1056 1057 1057 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 1113 1113 // the path defines the post_ID (archives/p/XXXX) 1114 1114 $blah = explode('/', $match[0]); 1115 $post_ID = $blah[1];1115 $post_ID = (int) $blah[1]; 1116 1116 $way = 'from the path'; 1117 1117 } elseif (preg_match('#p=[0-9]{1,}#', $urltest['query'], $match)) { 1118 1118 // the querystring defines the post_ID (?p=XXXX) 1119 1119 $blah = explode('=', $match[0]); 1120 $post_ID = $blah[1];1120 $post_ID = (int) $blah[1]; 1121 1121 $way = 'from the querystring'; 1122 1122 } elseif (isset($urltest['fragment'])) { … … 1124 1124 if (intval($urltest['fragment'])) { 1125 1125 // ...an integer #XXXX (simpliest case) 1126 $post_ID = $urltest['fragment'];1126 $post_ID = (int) $urltest['fragment']; 1127 1127 $way = 'from the fragment (numeric)'; 1128 1128 } elseif (preg_match('/post-[0-9]+/',$urltest['fragment'])) {
Note: See TracChangeset
for help on using the changeset viewer.