Ticket #4469: xmlrpc.php.3.diff

File xmlrpc.php.3.diff, 4.2 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                                switch($content_struct["mt_allow_comments"]) { 
     999                                        case "closed": 
     1000                                                $comment_status = "closed"; 
     1001                                                break; 
     1002                                        case "open": 
     1003                                                $comment_status = "open"; 
     1004                                                break; 
     1005                                        default: 
     1006                                                $comment_status = get_option("default_comment_status"); 
     1007                                                break; 
     1008                                } 
    10071009                        } 
     1010                        else { 
     1011                                switch((int) $content_struct["mt_allow_comments"]) { 
     1012                                        case 0: 
     1013                                                $comment_status = "closed"; 
     1014                                                break; 
     1015                                        case 1: 
     1016                                                $comment_status = "open"; 
     1017                                                break; 
     1018                                        default: 
     1019                                                $comment_status = get_option("default_comment_status"); 
     1020                                                break; 
     1021                                } 
     1022                        } 
    10081023                } 
     1024                else { 
     1025                        $comment_status = get_option("default_comment_status"); 
     1026                } 
    10091027 
    10101028                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; 
     1029                        if(!is_numeric($content_struct["mt_allow_pings"])) { 
     1030                                switch($content["mt_allow_pings"]) { 
     1031                                        case "closed": 
     1032                                                $ping_status = "closed"; 
     1033                                                break;   
     1034                                        case "open": 
     1035                                                $ping_status = "open"; 
     1036                                                break; 
     1037                                        default: 
     1038                                                $ping_status = get_option("default_ping_status"); 
     1039                                                break; 
     1040                                } 
    10211041                        } 
     1042                        else { 
     1043                                switch((int) $content_struct["mt_allow_pings"]) { 
     1044                                        case 0: 
     1045                                                $ping_status = "closed"; 
     1046                                                break; 
     1047                                        case 1: 
     1048                                                $ping_status = "open"; 
     1049                                                break; 
     1050                                        default: 
     1051                                                $ping_status = get_option("default_ping_status"); 
     1052                                                break; 
     1053                                } 
     1054                        } 
    10221055                } 
     1056                else { 
     1057                        $ping_status = get_option("default_ping_status"); 
     1058                } 
    10231059 
    10241060          if ($post_more) { 
    10251061            $post_content = $post_content . "\n<!--more-->\n" . $post_more; 
     
    11701206                        $post_author = $content_struct["wp_author_id"]; 
    11711207                } 
    11721208 
     1209                if(isset($content_struct["mt_allow_comments"])) { 
     1210                        if(!is_numeric($content_struct["mt_allow_comments"])) { 
     1211                                switch($content_struct["mt_allow_comments"]) { 
     1212                                        case "closed": 
     1213                                                $comment_status = "closed"; 
     1214                                                break; 
     1215                                        case "open": 
     1216                                                $comment_status = "open"; 
     1217                                                break; 
     1218                                        default: 
     1219                                                $comment_status = get_option("default_comment_status"); 
     1220                                                break; 
     1221                                } 
     1222                        } 
     1223                        else { 
     1224                                switch((int) $content_struct["mt_allow_comments"]) { 
     1225                                        case 0: 
     1226                                                $comment_status = "closed"; 
     1227                                                break; 
     1228                                        case 1: 
     1229                                                $comment_status = "open"; 
     1230                                                break; 
     1231                                        default: 
     1232                                                $comment_status = get_option("default_comment_status"); 
     1233                                                break; 
     1234                                } 
     1235                        } 
     1236                } 
     1237 
     1238                if(isset($content_struct["mt_allow_pings"])) { 
     1239                        if(!is_numeric($content_struct["mt_allow_pings"])) { 
     1240                                switch($content["mt_allow_pings"]) { 
     1241                                        case "closed": 
     1242                                                $ping_status = "closed"; 
     1243                                                break;   
     1244                                        case "open": 
     1245                                                $ping_status = "open"; 
     1246                                                break; 
     1247                                        default: 
     1248                                                $ping_status = get_option("default_ping_status"); 
     1249                                                break; 
     1250                                } 
     1251                        } 
     1252                        else { 
     1253                                switch((int) $content_struct["mt_allow_pings"]) { 
     1254                                        case 0: 
     1255                                                $ping_status = "closed"; 
     1256                                                break; 
     1257                                        case 1: 
     1258                                                $ping_status = "open"; 
     1259                                                break; 
     1260                                        default: 
     1261                                                $ping_status = get_option("default_ping_status"); 
     1262                                                break; 
     1263                                } 
     1264                        } 
     1265                } 
     1266 
    11731267                // Only set ping_status if it was provided. 
    11741268                if(isset($content_struct["mt_allow_pings"])) { 
    11751269                        switch((int) $content_struct["mt_allow_pings"]) { 
     
    12131307          if ( is_array($to_ping) ) 
    12141308                $to_ping = implode(' ', $to_ping); 
    12151309 
    1216       if(isset($content_struct["mt_allow_comments"])) { 
    1217                 $comment_status = (int) $content_struct["mt_allow_comments"]; 
    1218       } 
    1219  
    12201310          // Do some timestamp voodoo 
    12211311          $dateCreatedd = $content_struct['dateCreated']; 
    12221312          if (!empty($dateCreatedd)) {