Ticket #15737: blogger-importer.patch
| File blogger-importer.patch, 2.5 KB (added by joostdevalk, 2 years ago) |
|---|
-
trunk/blogger-importer.php
226 226 227 227 $interval = STATUS_INTERVAL * 1000; 228 228 229 $init = ''; 230 $rows = ''; 231 229 232 foreach ( $this->blogs as $i => $blog ) { 230 233 if ( $blog['mode'] == 'init' ) 231 234 $value = $start; … … 684 687 $tothis = __('WordPress login', 'blogger-importer'); 685 688 $submit = esc_js( __('Save Changes', 'blogger-importer') ); 686 689 690 $rows = ''; 687 691 foreach ( $blog['authors'] as $i => $author ) 688 692 $rows .= "<tr><td><label for='authors[$i]'>{$author[0]}</label></td><td><select name='authors[$i]' id='authors[$i]'>" . $this->get_user_options($author[1]) . "</select></td></tr>"; 689 693 … … 694 698 global $importer_users; 695 699 if ( ! isset( $importer_users ) ) 696 700 $importer_users = (array) get_users_of_blog(); 697 701 702 $options = ''; 703 698 704 foreach ( $importer_users as $user ) { 699 $sel = ( $user-> user_id== $current ) ? " selected='selected'" : '';700 $options .= "<option value=' $user->user_id'$sel>$user->display_name</option>";705 $sel = ( $user->data->ID == $current ) ? " selected='selected'" : ''; 706 $options .= "<option value='".$user->data->ID."'$sel>$user->display_name</option>"; 701 707 } 702 708 703 709 return $options; … … 761 767 } 762 768 763 769 function _txrx( $sock, $request ) { 770 $response = ''; 764 771 fwrite( $sock, $request ); 765 772 while ( ! feof( $sock ) ) 766 773 $response .= @ fread ( $sock, 8192 ); … … 805 812 $response_header_array = array(); 806 813 foreach($response_header_lines as $header_line) { 807 814 list($header,$value) = explode(': ', $header_line, 2); 808 $response_header_array[$header] .= $value."\n"; 815 if ( isset($response_header_array[$header]) ) 816 $response_header_array[$header] .= $value."\n"; 817 else 818 $response_header_array[$header] = $value."\n"; 809 819 } 810 820 811 821 $cookie_array = array(); 812 $cookies = explode("\n", $response_header_array["Set-Cookie"]); 813 foreach($cookies as $this_cookie) { array_push($cookie_array, "Cookie: ".$this_cookie); } 814 822 if ( isset($response_header_array["Set-Cookie"]) ) 823 $cookies = explode("\n", $response_header_array["Set-Cookie"]); 824 825 if ( isset($cookies) && is_array($cookies) ) { 826 foreach($cookies as $this_cookie) { 827 array_push($cookie_array, "Cookie: ".$this_cookie); 828 } 829 } 815 830 return array("code" => $response_code, "header" => $response_header_array, "cookies" => $cookie_array, "body" => $response_body); 816 831 } 817 832
