Ticket #4469: xmlrpc.php.diff

File xmlrpc.php.diff, 3.1 kB (added by josephscott, 1 year ago)
  • xmlrpc.php

    old new  
    994994          $post_more = $content_struct['mt_text_more']; 
    995995 
    996996                if(isset($content_struct["mt_allow_comments"])) { 
    997                         switch((int) $content_struct["mt_allow_comments"]) { 
    998                                 case 0: 
    999                                         $comment_status = "closed"; 
    1000                                         break; 
    1001                                 case 1: 
    1002                                         $comment_status = "open"; 
    1003                                         break; 
    1004                                 default: 
    1005                                         $comment_status = get_option("default_comment_status"); 
    1006                                         break; 
     997                        if(!is_numeric($content_struct["mt_allow_comments"])) { 
     998                                $comment_status = $content_struct["mt_allow_comments"]; 
    1007999                        } 
     1000                        else { 
     1001                                switch((int) $content_struct["mt_allow_comments"]) { 
     1002                                        case 0: 
     1003                                                $comment_status = "closed"; 
     1004                                                break; 
     1005                                        case 1: 
     1006                                                $comment_status = "open"; 
     1007                                                break; 
     1008                                        default: 
     1009                                                $comment_status = get_option("default_comment_status"); 
     1010                                                break; 
     1011                                } 
     1012                        } 
    10081013                } 
    10091014 
    10101015                if(isset($content_struct["mt_allow_pings"])) { 
    1011                         switch((int) $content_struct["mt_allow_pings"]) { 
    1012                                 case 0: 
    1013                                         $ping_status = "closed"; 
    1014                                         break; 
    1015                                 case 1: 
    1016                                         $ping_status = "open"; 
    1017                                         break; 
    1018                                 default: 
    1019                                         $ping_status = get_option("default_ping_status"); 
    1020                                         break; 
     1016                        if(!is_numeric($content_struct["mt_allow_pings"])) { 
     1017                                $ping_status = $content_struct["mt_allow_pings"]; 
    10211018                        } 
     1019                        else { 
     1020                                switch((int) $content_struct["mt_allow_pings"]) { 
     1021                                        case 0: 
     1022                                                $ping_status = "closed"; 
     1023                                                break; 
     1024                                        case 1: 
     1025                                                $ping_status = "open"; 
     1026                                                break; 
     1027                                        default: 
     1028                                                $ping_status = get_option("default_ping_status"); 
     1029                                                break; 
     1030                                } 
     1031                        } 
    10221032                } 
    10231033 
    10241034          if ($post_more) { 
     
    11701180                        $post_author = $content_struct["wp_author_id"]; 
    11711181                } 
    11721182 
     1183                if(isset($content_struct["mt_allow_comments"])) { 
     1184                        if(!is_numeric($content_struct["mt_allow_comments"])) { 
     1185                                $comment_status = $content_struct["mt_allow_comments"]; 
     1186                        } 
     1187                        else { 
     1188                                switch((int) $content_struct["mt_allow_comments"]) { 
     1189                                        case 0: 
     1190                                                $comment_status = "closed"; 
     1191                                                break; 
     1192                                        case 1: 
     1193                                                $comment_status = "open"; 
     1194                                                break; 
     1195                                        default: 
     1196                                                $comment_status = get_option("default_comment_status"); 
     1197                                                break; 
     1198                                } 
     1199                        } 
     1200                } 
     1201 
     1202                if(isset($content_struct["mt_allow_pings"])) { 
     1203                        if(!is_numeric($content_struct["mt_allow_pings"])) { 
     1204                                $ping_status = $content_struct["mt_allow_pings"]; 
     1205                        } 
     1206                        else { 
     1207                                switch((int) $content_struct["mt_allow_pings"]) { 
     1208                                        case 0: 
     1209                                                $ping_status = "closed"; 
     1210                                                break; 
     1211                                        case 1: 
     1212                                                $ping_status = "open"; 
     1213                                                break; 
     1214                                        default: 
     1215                                                $ping_status = get_option("default_ping_status"); 
     1216                                                break; 
     1217                                } 
     1218                        } 
     1219                } 
     1220 
    11731221                // Only set ping_status if it was provided. 
    11741222                if(isset($content_struct["mt_allow_pings"])) { 
    11751223                        switch((int) $content_struct["mt_allow_pings"]) { 
     
    12131261          if ( is_array($to_ping) ) 
    12141262                $to_ping = implode(' ', $to_ping); 
    12151263 
    1216       if(isset($content_struct["mt_allow_comments"])) { 
    1217                 $comment_status = (int) $content_struct["mt_allow_comments"]; 
    1218       } 
    1219  
    12201264          // Do some timestamp voodoo 
    12211265          $dateCreatedd = $content_struct['dateCreated']; 
    12221266          if (!empty($dateCreatedd)) {