Ticket #4469: xmlrpc.php.2.diff
File xmlrpc.php.2.diff, 3.8 KB (added by , 14 years ago) |
---|
-
xmlrpc.php
994 994 $post_more = $content_struct['mt_text_more']; 995 995 996 996 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 } 1007 1009 } 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 } 1008 1023 } 1024 else { 1025 $comment_status = get_option("default_comment_status"); 1026 } 1009 1027 1010 1028 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 } 1021 1041 } 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 } 1022 1055 } 1056 else { 1057 $ping_status = get_option("default_ping_status"); 1058 } 1023 1059 1024 1060 if ($post_more) { 1025 1061 $post_content = $post_content . "\n<!--more-->\n" . $post_more; … … 1170 1206 $post_author = $content_struct["wp_author_id"]; 1171 1207 } 1172 1208 1209 if(isset($content_struct["mt_allow_comments"])) { 1210 if(!is_numeric($content_struct["mt_allow_comments"])) { 1211 $comment_status = $content_struct["mt_allow_comments"]; 1212 } 1213 else { 1214 switch((int) $content_struct["mt_allow_comments"]) { 1215 case 0: 1216 $comment_status = "closed"; 1217 break; 1218 case 1: 1219 $comment_status = "open"; 1220 break; 1221 default: 1222 $comment_status = get_option("default_comment_status"); 1223 break; 1224 } 1225 } 1226 } 1227 1228 if(isset($content_struct["mt_allow_pings"])) { 1229 if(!is_numeric($content_struct["mt_allow_pings"])) { 1230 $ping_status = $content_struct["mt_allow_pings"]; 1231 } 1232 else { 1233 switch((int) $content_struct["mt_allow_pings"]) { 1234 case 0: 1235 $ping_status = "closed"; 1236 break; 1237 case 1: 1238 $ping_status = "open"; 1239 break; 1240 default: 1241 $ping_status = get_option("default_ping_status"); 1242 break; 1243 } 1244 } 1245 } 1246 1173 1247 // Only set ping_status if it was provided. 1174 1248 if(isset($content_struct["mt_allow_pings"])) { 1175 1249 switch((int) $content_struct["mt_allow_pings"]) { … … 1213 1287 if ( is_array($to_ping) ) 1214 1288 $to_ping = implode(' ', $to_ping); 1215 1289 1216 if(isset($content_struct["mt_allow_comments"])) {1217 $comment_status = (int) $content_struct["mt_allow_comments"];1218 }1219 1220 1290 // Do some timestamp voodoo 1221 1291 $dateCreatedd = $content_struct['dateCreated']; 1222 1292 if (!empty($dateCreatedd)) {