php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63696 PHP.net: Manual "Add note" script broken on php.net
Submitted: 2012-12-05 12:00 UTC Modified: 2012-12-05 17:13 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: krinklemail at gmail dot com Assigned: danbrown (profile)
Status: Closed Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2012-12-05 12:00 UTC] krinklemail at gmail dot com
Description:
------------
Steps to reproduce problem:
* Go to http://php.net/manual/add-note.php?
sect=reserved.variables.server&redirect=http://php.net/manual/en/reserved.variable
s.server.php
* Fill in the form
* Submit the form (use Preview if you want to avoid sending the submission for 
real)

Expected result:
* add-note.php adds type=hidden fields for GET[sect] and GET[redirect]
* Together with my input, they are sent over POST to the server
* Response: "Your submission was successful -- thanks for contributing!"

Actual result:
* add-note.php adds type=hidden fields for GET[sect] and GET[redirect]
* Together with my input, they are sent over POST to the server
* Response: The same page again, but without the form. Message "To add a note, you 
must click on the "Add Note" button" in place of the form.


This is caused by the fact that php.net pages have a <base> tag, set to 
www.php.net and www.php.net is a 301 redirect to php.net.

So the POST request is forwarded as GET, without the POST payload. And worst of 
all, it is a loop (pressing Submit press will loop back, and then the same).

Assuming that www is always a redirect and that <base> is also outputted on other 
pages, this bug will be happening on any POST request, not just add-note.php.

Please fix the <base> tag for php.net to point to php.net, not www.php.net.

PS: What is the purpose of this <base> tag anyway?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-05 17:13 UTC] danbrown@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: danbrown
 [2012-12-05 17:13 UTC] danbrown@php.net
We recently made some changes to better-serve the website users, and one of the 
most drastic changes created an error with the 301 redirects.

I made two moderately-sized batch commits to the website repositories this 
morning, and updated the primary web server configuration to resolve this and 
several other issues.

The base tag just tells the client that all media and links not referred with a 
static hostname should be accessed from the provided domain.  Thus:

http://php.example.net/images/logo.png // Will always go to php.example.net
/images/logo.png // Will be loaded from the <base href="(.*)"> host
images/logo.png // Will be loaded from the <base href="(.*)"> host

Thanks for your investigation and report.  Please let us know if you continue to 
experience problems, or discover new issues with the website.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 03:02:51 2024 UTC