Changeset 549 for trunk/b2comments.post.php
- Timestamp:
- 11/15/2003 08:58:18 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/b2comments.post.php
r546 r549 44 44 die('Sorry, comments are closed for this item.'); 45 45 46 if ($require_name_email && ($email == '' || $email == '@' || $author == '' || $author == 'name')) { //original fix by Dodo, and then Drinyth 47 echo 'Error: please fill the required fields (name, email).'; 48 exit; 46 if ($require_name_email && ($email == '' || $author == '')) { //original fix by Dodo, and then Drinyth 47 die('Error: please fill the required fields (name, email).'); 49 48 } 50 49 if ($comment == 'comment' || $comment == '') { 51 echo "Error: please type a comment"; 52 exit; 50 die('Error: please type a comment.'); 53 51 } 54 52 55 $time_difference = get_settings('time_difference'); 56 $now = date('Y-m-d H:i:s',(time() + ($time_difference * 3600)));53 54 $now = current_time('mysql'); 57 55 58 56 $comment = strip_tags($comment, $comment_allowed_tags); … … 69 67 $url = addslashes($url); 70 68 71 /* flood-protection */69 /* Flood-protection */ 72 70 $lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1"); 73 71 $ok = true; … … 78 76 $ok = false; 79 77 } 80 /* end flood-protection */78 /* End flood-protection */ 81 79 82 80 83 81 84 82 if ($ok) { // if there was no comment from this IP in the last 10 seconds 85 $comment_moderation = get_settings( "comment_moderation");86 $moderation_notify = get_settings( "moderation_notify");83 $comment_moderation = get_settings('comment_moderation'); 84 $moderation_notify = get_settings('moderation_notify'); 87 85 88 86 // o42: this place could be the hook for further comment spam checking … … 98 96 $wpdb->query("INSERT INTO $tablecomments (comment_ID,comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_content,comment_karma,comment_approved) VALUES ('0', '$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$comment', '0', '$approved')"); 99 97 100 // o42: this should be changed as soon as other sql dbs are supported 101 // as it's proprietary to mysql 102 $comment_ID = $wpdb->get_var("SELECT last_insert_id()"); 98 /* 99 $comment_ID = $wpdb->get_var('SELECT last_insert_id()'); 103 100 104 101 $fp = fopen("/tmp/wpdebug.txt", "w+"); … … 118 115 fclose($fp); 119 116 117 */ 120 118 if ($email == '') 121 119 $email = ' '; // this to make sure a cookie is set for 'no email' … … 128 126 setcookie('comment_author_url_'.$cookiehash, $url, time()+30000000); 129 127 130 131 128 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 129 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 132 130 header('Cache-Control: no-cache, must-revalidate'); 133 131 header('Pragma: no-cache'); 134 $location = ( !empty($HTTP_POST_VARS['redirect_to'])) ? $HTTP_POST_VARS['redirect_to'] : $HTTP_SERVER_VARS["HTTP_REFERER"];132 $location = (empty($HTTP_POST_VARS['redirect_to'])) ? $HTTP_SERVER_VARS["HTTP_REFERER"] : $HTTP_POST_VARS['redirect_to']; 135 133 if ($is_IIS) { 136 134 header("Refresh: 0;url=$location");
Note: See TracChangeset
for help on using the changeset viewer.