Ticket #4469: xmlrpc.php.diff
File xmlrpc.php.diff, 3.1 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 $comment_status = $content_struct["mt_allow_comments"]; 1007 999 } 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 } 1008 1013 } 1009 1014 1010 1015 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"]; 1021 1018 } 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 } 1022 1032 } 1023 1033 1024 1034 if ($post_more) { … … 1170 1180 $post_author = $content_struct["wp_author_id"]; 1171 1181 } 1172 1182 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 1173 1221 // Only set ping_status if it was provided. 1174 1222 if(isset($content_struct["mt_allow_pings"])) { 1175 1223 switch((int) $content_struct["mt_allow_pings"]) { … … 1213 1261 if ( is_array($to_ping) ) 1214 1262 $to_ping = implode(' ', $to_ping); 1215 1263 1216 if(isset($content_struct["mt_allow_comments"])) {1217 $comment_status = (int) $content_struct["mt_allow_comments"];1218 }1219 1220 1264 // Do some timestamp voodoo 1221 1265 $dateCreatedd = $content_struct['dateCreated']; 1222 1266 if (!empty($dateCreatedd)) {