Skip to content

Commit

Permalink
Use HTTPS URL for event submission to main.php.net
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iansltx committed Jun 22, 2024
1 parent a5283a1 commit 6e62f29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion submit-event.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

if (isset($_POST['action']) && $_POST['action'] === 'Submit' && empty($errors)) {
// Submit to main.php.net
$result = posttohost("http://main.php.net/entry/event.php", $_POST);
$result = posttohost("https://main.php.net/entry/event.php", $_POST);
if ($result) {
$errors[] = "There was an error processing your submission: $result";
}
Expand Down

0 comments on commit 6e62f29

Please sign in to comment.