Skip to content

Commit bd48730

Browse files
authored
Use HTTPS URL for event submission to main.php.net, match spam check expectation to web-master (#1017)
* Use HTTPS URL for event submission to main.php.net Resolves #999 At some point in the past 12 years (this line was modified in the last 3 years but I doubt it got tested when modified) main.php.net started redirecting insecure HTTP to HTTPS, including for POSTs. The catch with those redirects is that POSTs won't get resubmitted when redirected, so when submitting an event the redirect would result in a GET with no parameters to the event submission endpoint, hence "Missing parameters." So event submission has been broken since main.php.net started redirecting HTTP to HTTPS. Back in 2012 there was an attempt to switch this and other URLs to HTTPS, but it got rolled back because "there could be mirrors without ssl support." (see blame for the line this commit modifies). Since then, mirrors have been phased out, so we can safely assume we're calling HTTPS endpoints now (and that's the only way this will work anyway). Verified by hitting the mentioned endpoint both on HTTP and HTTPS. HTTP gets redirected and fails due to missing parameters, HTTPS makes it through to the next step. * Match "sane" value on event submission to web-master expectation This reverts part of f1b8134 as that wasn't quite the right fix
1 parent fadb53c commit bd48730

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

submit-event.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@
110110
}
111111

112112
// Spam question
113-
if ($_POST["sane"] != 4) {
113+
if ($_POST["sane"] != 3) {
114114
$errors[] = "It's OK. I'm not real either";
115115
}
116116

117117
if (isset($_POST['action']) && $_POST['action'] === 'Submit' && empty($errors)) {
118118
// Submit to main.php.net
119-
$result = posttohost("http://main.php.net/entry/event.php", $_POST);
119+
$result = posttohost("https://main.php.net/entry/event.php", $_POST);
120120
if ($result) {
121121
$errors[] = "There was an error processing your submission: $result";
122122
}
@@ -257,7 +257,7 @@
257257
</tr>
258258
<tr>
259259
<th class="subr">Are you real?</th>
260-
<td><select name="sane"><?php display_options(["I, Robot", "I used to be", "WTF?", "No, but I'd still want to submit this", "Yes"], "2"); ?></select></td>
260+
<td><select name="sane"><?php display_options(["I, Robot", "I used to be", "WTF?", "Yes", "No, but I'd still want to submit this"], "2"); ?></select></td>
261261
</tr>
262262
</table>
263263
</form>

0 commit comments

Comments
 (0)