Changeset 2668 for trunk/xmlrpc.php
- Timestamp:
- 06/28/2005 10:16:27 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xmlrpc.php
r2653 r2668 128 128 } 129 129 130 131 130 function escape(&$array) { 131 global $wpdb; 132 133 foreach ($array as $k => $v) { 134 if (is_array($v)) { 135 $this->escape($array[$k]); 136 } else { 137 $array[$k] = $wpdb->escape($v); 138 } 139 } 140 } 132 141 133 142 /* Blogger API functions … … 138 147 /* blogger.getUsersBlogs will make more sense once we support multiple blogs */ 139 148 function blogger_getUsersBlogs($args) { 149 150 $this->escape($args); 140 151 141 152 $user_login = $args[1]; … … 162 173 /* blogger.getUsersInfo gives your client some info about you, so you don't have to */ 163 174 function blogger_getUserInfo($args) { 175 176 $this->escape($args); 164 177 165 178 $user_login = $args[1]; … … 188 201 function blogger_getPost($args) { 189 202 203 $this->escape($args); 204 190 205 $post_ID = $args[1]; 191 206 $user_login = $args[2]; … … 221 236 global $wpdb; 222 237 238 $this->escape($args); 239 223 240 $blog_ID = $args[1]; /* though we don't use it yet */ 224 241 $user_login = $args[2]; … … 267 284 function blogger_getTemplate($args) { 268 285 286 $this->escape($args); 287 269 288 $blog_ID = $args[1]; 270 289 $user_login = $args[2]; … … 299 318 /* blogger.setTemplate updates the content of blog_filename */ 300 319 function blogger_setTemplate($args) { 320 321 $this->escape($args); 301 322 302 323 $blog_ID = $args[1]; … … 336 357 global $wpdb; 337 358 359 $this->escape($args); 360 338 361 $blog_ID = $args[1]; /* though we don't use it yet */ 339 362 $user_login = $args[2]; … … 383 406 global $wpdb; 384 407 408 $this->escape($args); 409 385 410 $post_ID = $args[1]; 386 411 $user_login = $args[2]; … … 399 424 } 400 425 426 $this->escape($actual_post); 427 401 428 $post_author_data = get_userdata($actual_post['post_author']); 402 429 $user_data = get_userdatabylogin($user_login); … … 407 434 408 435 extract($actual_post); 436 409 437 $content = $newcontent; 410 438 … … 431 459 432 460 global $wpdb; 461 462 $this->escape($args); 433 463 434 464 $post_ID = $args[1]; … … 472 502 473 503 global $wpdb, $post_default_category; 504 505 $this->escape($args); 474 506 475 507 $blog_ID = $args[0]; // we will support this in the near future … … 554 586 global $wpdb, $post_default_category; 555 587 588 $this->escape($args); 589 556 590 $post_ID = $args[0]; 557 591 $user_login = $args[1]; … … 571 605 $postdata = wp_get_single_post($post_ID, ARRAY_A); 572 606 extract($postdata); 607 $this->escape($postdata); 573 608 574 609 $post_title = $content_struct['title']; … … 631 666 632 667 global $wpdb; 668 669 $this->escape($args); 633 670 634 671 $post_ID = $args[0]; … … 685 722 function mw_getRecentPosts($args) { 686 723 724 $this->escape($args); 725 687 726 $blog_ID = $args[0]; 688 727 $user_login = $args[1]; … … 749 788 global $wpdb; 750 789 790 $this->escape($args); 791 751 792 $blog_ID = $args[0]; 752 793 $user_login = $args[1]; … … 781 822 // http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/ 782 823 824 $this->escape($args); 825 783 826 $blog_ID = $args[0]; 784 827 $user_login = $args[1]; … … 860 903 function mt_getRecentPostTitles($args) { 861 904 905 $this->escape($args); 906 862 907 $blog_ID = $args[0]; 863 908 $user_login = $args[1]; … … 903 948 global $wpdb; 904 949 950 $this->escape($args); 951 905 952 $blog_ID = $args[0]; 906 953 $user_login = $args[1]; … … 929 976 /* mt.getPostCategories ...returns a post's categories */ 930 977 function mt_getPostCategories($args) { 978 979 $this->escape($args); 931 980 932 981 $post_ID = $args[0]; … … 958 1007 function mt_setPostCategories($args) { 959 1008 1009 $this->escape($args); 1010 960 1011 $post_ID = $args[0]; 961 1012 $user_login = $args[1]; … … 1040 1091 function mt_publishPost($args) { 1041 1092 1093 $this->escape($args); 1094 1042 1095 $post_ID = $args[0]; 1043 1096 $user_login = $args[1]; … … 1060 1113 $cats = wp_get_post_cats('',$post_ID); 1061 1114 $postdata['post_category'] = $cats; 1115 $this->escape($postdata); 1062 1116 1063 1117 $result = wp_update_post($postdata); … … 1075 1129 function pingback_ping($args) { 1076 1130 global $wpdb, $wp_version; 1131 1132 $this->escape($args); 1077 1133 1078 1134 $pagelinkedfrom = $args[0]; … … 1220 1276 global $wpdb; 1221 1277 1278 $this->escape($args); 1279 1222 1280 $url = $args; 1223 1281
Note: See TracChangeset
for help on using the changeset viewer.