Ticket #4469: xmlrpc.php.3.diff
File xmlrpc.php.3.diff, 4.2 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 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 1173 1267 // Only set ping_status if it was provided. 1174 1268 if(isset($content_struct["mt_allow_pings"])) { 1175 1269 switch((int) $content_struct["mt_allow_pings"]) { … … 1213 1307 if ( is_array($to_ping) ) 1214 1308 $to_ping = implode(' ', $to_ping); 1215 1309 1216 if(isset($content_struct["mt_allow_comments"])) {1217 $comment_status = (int) $content_struct["mt_allow_comments"];1218 }1219 1220 1310 // Do some timestamp voodoo 1221 1311 $dateCreatedd = $content_struct['dateCreated']; 1222 1312 if (!empty($dateCreatedd)) {