Commit:    f1b8134041b8afefd18e0013a07e1aa310c38c44
Author:    Kalle Sommer Nielsen <ka...@php.net>         Sun, 17 Mar 2019 
22:47:36 +0200
Parents:   755dd7108ef06de91a8547f6763a215905f9a6fc
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=f1b8134041b8afefd18e0013a07e1aa310c38c44

Log:
Attempt at hopefully fixing some of the spam coming to the event calendar:
- Move the sanity check option around
- The long description must now contain the word "PHP"

Changed paths:
  M  submit-event.php


Diff:
diff --git a/submit-event.php b/submit-event.php
index 331e113..26dbd47 100644
--- a/submit-event.php
+++ b/submit-event.php
@@ -63,6 +63,9 @@ if ($process) {
     if (!$_POST['ldesc']) {
         $errors[] = "You must supply a long description of the event.";
     }
+    elseif (stripos($_POST['ldesc'], 'PHP') === false) {
+        $errors[] = "This does not look like a 'PHP' event";
+    }
 
     $valid_schemes = array('http','https','ftp');
 
@@ -114,7 +117,7 @@ if ($process) {
     }
 
     // Spam question
-    if ($_POST["sane"] != 3) {
+    if ($_POST["sane"] != 4) {
         $errors[] = "It's OK. I'm not real either";
     }
 
@@ -261,7 +264,7 @@ if ($process && count($errors) === 0) {
  </tr>
  <tr>
   <th class="subr">Are you real?</th>
-  <td><select name="sane"><?php display_options(array("I, Robot", "I used to 
be", "WTF?", "Yes", "No, but I'd still want to submit this"), "2"); 
?></select></td>
+  <td><select name="sane"><?php display_options(array("I, Robot", "I used to 
be", "WTF?", "No, but I'd still want to submit this", "Yes"), "2"); 
?></select></td>
  </tr>
 </table>
 </form>


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to