Changeset 5087 for trunk/xmlrpc.php
- Timestamp:
- 03/23/2007 12:59:21 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.