Last modified: 2011-04-14 15:12:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T13378, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11378 - Transwiki Special:Import via redirected interwiki URL spews PHP error about HTTP error
Transwiki Special:Import via redirected interwiki URL spews PHP error about H...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Export/Import (Other open bugs)
1.12.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-17 20:55 UTC by Brion Vibber
Modified: 2011-04-14 15:12 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2007-09-17 20:55:13 UTC
When testing a transwiki/interwiki import from Wikipedia to my local test wiki, I found i was getting this PHP error spewed out:

<b>Warning</b>:  file_get_contents(http://www.wikipedia.org/wiki/Special:Export/About?history=1) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.0 411 Length Required
 in <b>/opt/web/pages/trunk/includes/HttpFunctions.php</b> on line <b>83</b><br />


My local interwiki table was using www.wikipedia.org URLs, which return an HTTP 301 redirect. Note that the local wiki doesn't have CURL set up and is using the file_get_contents() path.

A POST request is used for the import, I'm not 100% sure why. Unfortunately at least file_get_contents() doesn't seem to handle redirects properly. It follows the target URL, doing another POST, but apparently without all the headers. The Content-Length header, required for POSTs, is being lost, so the target server returns an HTTP server on the subrequest.


Proper behavior would be to use a GET in the first place, or to resubmit at the new URL with the correct headers. HTTP 1.1 spec says a user-agent MUST NOT follow through a POST across a redirect without user confirmation; for this case the system's knowledge of wikis should be enough if we actually do it right though. ;)

I'm not sure what happens in the CURL case, haven't tested.
Comment 1 Siebrand Mazeland 2008-08-18 18:55:31 UTC
Mass compoment change: <some> -> Export/Import

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links