Ticket #10665: XMLRPCSafety.diff
File XMLRPCSafety.diff, 3.1 KB (added by , 15 years ago) |
---|
-
xmlrpc.php
2189 2189 $post_content = $post_content . "<!--more-->" . $post_more; 2190 2190 } 2191 2191 2192 $to_ping = $content_struct['mt_tb_ping_urls']; 2193 if ( is_array($to_ping) ) 2194 $to_ping = implode(' ', $to_ping); 2192 2193 $to_ping = NULL; 2194 if ( isset( $content_struct['mt_tb_ping_urls'] ) ) { 2195 $to_ping = $content_struct['mt_tb_ping_urls']; 2196 if ( is_array($to_ping) ) 2197 $to_ping = implode(' ', $to_ping); 2198 } 2195 2199 2196 2200 // Do some timestamp voodoo 2197 2201 if ( !empty( $content_struct['date_created_gmt'] ) ) … … 2207 2211 $post_date_gmt = current_time('mysql', 1); 2208 2212 } 2209 2213 2210 $catnames = $content_struct['categories'];2211 logIO('O', 'Post cats: ' . var_export($catnames,true));2212 2214 $post_category = array(); 2215 if ( isset( $content_struct['categories'] ) ) { 2216 $catnames = $content_struct['categories']; 2217 logIO('O', 'Post cats: ' . var_export($catnames,true)); 2213 2218 2214 if (is_array($catnames)) { 2215 foreach ($catnames as $cat) { 2216 $post_category[] = get_cat_ID($cat); 2219 if (is_array($catnames)) { 2220 foreach ($catnames as $cat) { 2221 $post_category[] = get_cat_ID($cat); 2222 } 2217 2223 } 2218 2224 } 2219 2225 … … 2239 2245 $this->set_custom_fields($post_ID, $content_struct['custom_fields']); 2240 2246 } 2241 2247 2248 2242 2249 // Handle enclosures 2243 $this->add_enclosure_if_new($post_ID, $content_struct['enclosure']); 2250 $thisEnclosure = NULL; 2251 if ( isset($content_struct['enclosure']) ) 2252 $thisEnclosure = $content_struct['enclosure']; 2253 $this->add_enclosure_if_new($post_ID, $thisEnclosure); 2244 2254 2245 2255 $this->attach_uploads( $post_ID, $post_content ); 2246 2256 … … 2460 2470 2461 2471 $post_title = $content_struct['title']; 2462 2472 $post_content = apply_filters( 'content_save_pre', $content_struct['description'] ); 2463 $catnames = $content_struct['categories'];2464 2473 2465 2474 $post_category = array(); 2475 if ( isset( $content_struct['categories'] ) ) { 2476 $catnames = $content_struct['categories']; 2477 logIO('O', 'Post cats: ' . var_export($catnames,true)); 2466 2478 2467 if (is_array($catnames)) { 2468 foreach ($catnames as $cat) { 2469 $post_category[] = get_cat_ID($cat); 2479 if (is_array($catnames)) { 2480 foreach ($catnames as $cat) { 2481 $post_category[] = get_cat_ID($cat); 2482 } 2470 2483 } 2471 2484 } 2472 2485 … … 2506 2519 $post_content = $post_content . "<!--more-->" . $post_more; 2507 2520 } 2508 2521 2509 $to_ping = $content_struct['mt_tb_ping_urls']; 2510 if ( is_array($to_ping) ) 2511 $to_ping = implode(' ', $to_ping); 2522 $to_ping = NULL; 2523 if ( isset( $content_struct['mt_tb_ping_urls'] ) ) { 2524 $to_ping = $content_struct['mt_tb_ping_urls']; 2525 if ( is_array($to_ping) ) 2526 $to_ping = implode(' ', $to_ping); 2527 } 2512 2528 2513 2529 // Do some timestamp voodoo 2514 2530 if ( !empty( $content_struct['date_created_gmt'] ) ) … … 2547 2563 } 2548 2564 2549 2565 // Handle enclosures 2550 $this->add_enclosure_if_new($post_ID, $content_struct['enclosure']); 2566 $thisEnclosure = NULL; 2567 if ( isset($content_struct['enclosure']) ) 2568 $thisEnclosure = $content_struct['enclosure']; 2569 $this->add_enclosure_if_new($post_ID, $thisEnclosure); 2551 2570 2552 2571 $this->attach_uploads( $ID, $post_content ); 2553 2572