fixes for bug #311, by bronski

git-svn-id: http://svn.automattic.com/wordpress/trunk@1705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
michelvaldrighi 2004-09-22 19:44:35 +00:00
parent 93674897fc
commit 00d3d3fec9
2 changed files with 6 additions and 6 deletions

View File

@ -356,7 +356,7 @@ function wp_new_comment($commentdata) {
global $wpdb;
extract($commentdata);
$comment_post_id = (int) $comment_post_id;
$comment_post_ID = (int) $comment_post_ID;
$comment_author = strip_tags($comment_author);
$comment_author = htmlspecialchars($comment_author);
@ -385,7 +385,7 @@ function wp_new_comment($commentdata) {
die( __('Sorry, you can only post a new comment once every 15 seconds. Slow down cowboy.') );
}
if( check_comment($author, $email, $url, $comment, $user_ip, $user_agent) )
if( check_comment($comment_author, $comment_author_email, $comment_author_url, $comment_content, $user_ip, $user_agent) )
$approved = 1;
else
$approved = 0;
@ -393,7 +393,7 @@ function wp_new_comment($commentdata) {
$result = $wpdb->query("INSERT INTO $wpdb->comments
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent)
VALUES
('$comment_post_ID', '$author', '$email', '$tb_url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved', '$user_agent')
('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$user_ip', '$now', '$now_gmt', '$comment_content', '$approved', '$user_agent')
");
if ( get_option('comments_notify') )

View File

@ -62,14 +62,14 @@ if ( !empty($tb_url) && !empty($title) && !empty($tb_url) ) {
$blog_name = htmlspecialchars($blog_name);
$blog_name = (strlen($blog_name) > 250) ? substr($blog_name, 0, 250) . '...' : $blog_name;
$comment_post_id = $tb_id;
$commment_author = $blog_name;
$comment_post_ID = $tb_id;
$comment_author = $blog_name;
$comment_author_email = '';
$comment_author_url = $tb_url;
$comment_content = "<strong>$title</strong>\n\n$excerpt";
$comment_type = 'trackback';
$commentdata = compact('comment_post_id', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type');
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type');
wp_new_comment($commentdata);