Skip to content
Newer
Older
100644 52 lines (37 sloc) 1.71 KB
b43564c *** empty log message ***
saxmatt authored Apr 1, 2003
1 <?php
0990789 Fix for cookie paths being set correctly when using a different home …
saxmatt authored May 7, 2004
2 require( dirname(__FILE__) . '/wp-config.php' );
b43564c *** empty log message ***
saxmatt authored Apr 1, 2003
3
65bbec7 Comments refactoring and cleanup
saxmatt authored Dec 16, 2004
4 $comment_post_ID = (int) $_POST['comment_post_ID'];
b43564c *** empty log message ***
saxmatt authored Apr 1, 2003
5
a6f9511 Refuse comments for post IDs that do not exist.
rboren authored Nov 15, 2004
6 $post_status = $wpdb->get_var("SELECT comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");
7
8 if ( empty($post_status) ) {
65bbec7 Comments refactoring and cleanup
saxmatt authored Dec 16, 2004
9 do_action('comment_id_not_found', $comment_post_ID);
10 exit;
11 } elseif ( 'closed' == $post_status ) {
12 do_action('comment_closed', $comment_post_ID);
0990789 Fix for cookie paths being set correctly when using a different home …
saxmatt authored May 7, 2004
13 die( __('Sorry, comments are closed for this item.') );
a6f9511 Refuse comments for post IDs that do not exist.
rboren authored Nov 15, 2004
14 }
0990789 Fix for cookie paths being set correctly when using a different home …
saxmatt authored May 7, 2004
15
65bbec7 Comments refactoring and cleanup
saxmatt authored Dec 16, 2004
16 $comment_author = $_POST['author'];
17 $comment_author_email = $_POST['email'];
18 $comment_author_url = $_POST['url'];
19 $comment_content = $_POST['comment'];
20
21 $comment_type = '';
22
23 $user_ip = apply_filters('pre_comment_user_ip', $_SERVER['REMOTE_ADDR']);
24
0990789 Fix for cookie paths being set correctly when using a different home …
saxmatt authored May 7, 2004
25 if ( get_settings('require_name_email') && ('' == $email || '' == $author) )
26 die( __('Error: please fill the required fields (name, email).') );
27
7661787 http://mosquito.wordpress.org/view.php?id=558
saxmatt authored Dec 17, 2004
28 if ( '' == $comment_content )
0990789 Fix for cookie paths being set correctly when using a different home …
saxmatt authored May 7, 2004
29 die( __('Error: please type a comment.') );
8f10709 Check for comment status.
saxmatt authored Jun 4, 2003
30
65bbec7 Comments refactoring and cleanup
saxmatt authored Dec 16, 2004
31 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type');
b43564c *** empty log message ***
saxmatt authored Apr 1, 2003
32
65bbec7 Comments refactoring and cleanup
saxmatt authored Dec 16, 2004
33 wp_new_comment($commentdata);
88a6405 Email fixes, formatting changes.
saxmatt authored Sep 1, 2003
34
c1f391a Better redirect cleaning.
saxmatt authored Oct 5, 2004
35 setcookie('comment_author_' . COOKIEHASH, stripslashes($author), time() + 30000000, COOKIEPATH);
36 setcookie('comment_author_email_' . COOKIEHASH, stripslashes($email), time() + 30000000, COOKIEPATH);
37 setcookie('comment_author_url_' . COOKIEHASH, stripslashes($url), time() + 30000000, COOKIEPATH);
facb7af Fixed whitespace error, cleaned some formatting. Improved grammer on …
saxmatt authored Apr 7, 2003
38
65bbec7 Comments refactoring and cleanup
saxmatt authored Dec 16, 2004
39 header('Expires: Mon, 11 Jan 1984 05:00:00 GMT');
0990789 Fix for cookie paths being set correctly when using a different home …
saxmatt authored May 7, 2004
40 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
41 header('Cache-Control: no-cache, must-revalidate');
42 header('Pragma: no-cache');
c1f391a Better redirect cleaning.
saxmatt authored Oct 5, 2004
43
4f0449f Fixed minor bug - wrong variable passed to get_permalink() - caused
donncha authored Oct 6, 2004
44 $location = get_permalink($comment_post_ID);
c59a8a8 Changes to how we do redirects.
saxmatt authored Oct 5, 2004
45
0990789 Fix for cookie paths being set correctly when using a different home …
saxmatt authored May 7, 2004
46 if ($is_IIS) {
47 header("Refresh: 0;url=$location");
b43564c *** empty log message ***
saxmatt authored Apr 1, 2003
48 } else {
0990789 Fix for cookie paths being set correctly when using a different home …
saxmatt authored May 7, 2004
49 header("Location: $location");
b43564c *** empty log message ***
saxmatt authored Apr 1, 2003
50 }
51
65bbec7 Comments refactoring and cleanup
saxmatt authored Dec 16, 2004
52 ?>
Something went wrong with that request. Please try again.