Skip to content

Commit cecb8d6

Browse files
committed
pixelbeat-comments: adjust the spam protection in the form
I'm starting to get some spam in the last while, so change values in case existing ones in a DB somewhere.
1 parent db297bf commit cecb8d6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/comments/comments.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ def get(self):
9191
<script type="text/javascript">
9292
9393
/* If user isn't running javascript and
94-
they don't click the checkbox then comment lost */
94+
they don't answer correctly then comment lost.
95+
If are running JS then they get opportunity to fix. */
9596
function validateOnSubmit() {
9697
9798
var scheck = document.commentform.scheck.value;
98-
if (scheck != "3"+"9") {
99+
if (scheck != "4"+"0") {
99100
alert("incorrect answer");
100101
return false;
101102
}
@@ -164,7 +165,7 @@ def get(self):
164165
<tr><td> Name: </td> <td><input type="text" name="author" size="50"> </td></tr>
165166
<tr><td> Website: </td> <td><input type="text" name="url" size="50"> </td></tr>
166167
<tr><td style="vertical-align:top;"> comments: <br/>(no HTML) </td> <td><textarea name="content" rows="10" cols="63"></textarea></td></tr>
167-
<tr><td> 31+&#x38; </td> <td> <input type="text" name="scheck" id="scheck" size="50"> </td></tr>
168+
<tr><td> 31+&#x39; </td> <td> <input type="text" name="scheck" id="scheck" size="50"> </td></tr>
168169
</table>
169170
<input type="submit" value="Post">
170171
</form>
@@ -180,7 +181,7 @@ def post(self):
180181
#if users.get_current_user():
181182
# comment.user = users.get_current_user()
182183

183-
if self.request.get('scheck') != '3' + '9':
184+
if self.request.get('scheck') != '4' + '0':
184185
self.redirect('#commentform')
185186
return
186187

0 commit comments

Comments
 (0)