### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
1235 | 1235 | * @return int The ID of the comment after adding. |
1236 | 1236 | */ |
1237 | 1237 | function wp_new_comment( $commentdata ) { |
| 1238 | if ( get_bloginfo('html_type') == 'application/xhtml+xml' |
| 1239 | && get_bloginfo('charset') == 'UTF-8' ) { |
| 1240 | if ( $xml_parser = xml_parser_create('UTF-8') ){ |
| 1241 | $fake_xml_wrap = '<pre>' . $commentdata['comment_content'] . '</pre>'; |
| 1242 | if (!xml_parse($xml_parser, $fake_xml_wrap)) { |
| 1243 | $err = sprintf('XML error: %s at line %d column %d', |
| 1244 | xml_error_string(xml_get_error_code($xml_parser)), |
| 1245 | xml_get_current_line_number($xml_parser), |
| 1246 | xml_get_current_column_number($xml_parser)); |
| 1247 | wp_die( __($err) ); |
| 1248 | } |
| 1249 | } |
| 1250 | xml_parser_free($xml_parser); |
| 1251 | } |
1238 | 1252 | $commentdata = apply_filters('preprocess_comment', $commentdata); |
1239 | 1253 | |
1240 | 1254 | $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID']; |