Commit graph

111 commits

Author SHA1 Message Date
Mark A. Hershberger
014599f042 * Followup r75064 — fix misleading doc comment
* Don't let redirects set the status object to an error.
2010-10-21 18:18:00 +00:00
Mark A. Hershberger
1a2b825f45 follow up r75046 — Add getStatus() method to HttpRequest 2010-10-20 02:50:36 +00:00
Siebrand Mazeland
64fdb18e74 More whitespace updates for files touched in r72342:
* stylize.php run
* code formatting updates
* updated a few comments
* added braces where not used
2010-09-04 13:48:16 +00:00
Mark A. Hershberger
5dbbca7331 w/s changes 2010-09-04 01:06:34 +00:00
Alexandre Emsenhuber
4bb00ba65c Fixed some doxygen warnings 2010-07-02 21:22:38 +00:00
Tim Starling
6784f598b6 Let CookieJar work for hostnames without dots in them, so that ApiTest can work on my test wiki (and presumably most other localhost wikis). 2010-06-29 03:49:35 +00:00
Derk-Jan Hartman
e38132ec25 And one more \n in wfDebug. 2010-06-24 22:14:35 +00:00
Derk-Jan Hartman
2f4e28d9e3 Add a \n to the debug of the HTTP functions, so my debug log is readable. 2010-06-24 22:13:11 +00:00
Alexandre Emsenhuber
fa537d2d3f Fixed some doxygen warnings 2010-06-15 20:09:19 +00:00
Tim Starling
40eba8bb57 * Fix for r67684: in the curl backend, don't redirect if canFollowRedirects() returns false.
* Doxygen-compatible lists in Http::request() doc comment.
2010-06-11 06:10:54 +00:00
Tim Starling
b16fd61848 Fixes for r61911:
* Do not follow redirects by default. This breaks on safe_mode, and may potentially open security vulnerabilities in callers which blacklist domain names. Instead, send followRedirects=true option in the HttpTest caller that needs it.
* Added a check for the cURL security vulnerability CVE-2009-0037, which allowed redirects to file:/// and scp://. Refuse to follow redirects if a vulnerable client library is present.
* Factored out the redirect compatibility test into public function canFollowRedirects() so that callers can provide this information to users.
* In PhpHttpRequest, only follow redirects to HTTP URLs, do not fopen() arbitrary locations. This is not quite as bad as it sounds, since the lack of response headers prevents file:/// content from being returned to the caller.
* Fixed vertical alignment in Http::request(), per style guide.
* 304, 305 and 306 responses are not really redirects and cannot contain a Location header.
2010-06-09 06:39:22 +00:00
Platonides
1f048d2dae Follow up r67663. Stay quiet, T_OPEN_TAG! 2010-06-08 20:06:28 +00:00
Platonides
52d874ca62 Enable http compression.
Skip "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set" error.
2010-06-08 20:01:22 +00:00
Andrew Garrett
4901c2257d As well as fixing the broken implementation of sslVerifyHost, correct its documentation and implement a new option, sslVerifyCert, to do what the documentation said that sslVerifyHost did.
Note that CURLOPT_SSL_VERIFYHOST controls *only* the verification of hostname against the hostname on the certificate.
2010-04-25 23:10:53 +00:00
Andrew Garrett
5e9e490a6b HttpFunctions: Fix bug where sslVerifyHost was only added to the CURL options when it would have no effect anyway. 2010-04-25 22:53:19 +00:00
Mark A. Hershberger
bd3faaeb15 * Fix a bug to keep consecutive HTTP requests from sharing results
* Update Login API
2010-04-09 05:25:40 +00:00
Chad Horohoe
2b4ff9dfaa bug 18664, bug 19270: Relative URIs in interwiki table break things (in general: fix wfExpandUrl() so it handles protocol-relative URIs) 2010-03-17 00:21:52 +00:00
Mark A. Hershberger
116fe657e2 * Fixes Bug #22268
* Document parseHeader()
* Separate out setStatus() so it can be called from execute()
* Avoid core dumps on older PHPs when using PhpHttpRequest and doing redirects
* Add getResponseHeader() for getting the response headers
* Add special handling on tests for older PHP
2010-02-22 05:12:20 +00:00
Tim Starling
ba7a9c2959 Fix call to nonexistent function from r61357 2010-02-16 01:06:49 +00:00
Mark A. Hershberger
d74e55fc09 Fix problem of incorrect Status message use.
Uncovered an additional problem with HTTP error messages and PhpHttpRequest
2010-02-09 08:23:09 +00:00
Mark A. Hershberger
e51c98f687 fix messages for http non-200 messages 2010-02-09 06:46:20 +00:00
Mark A. Hershberger
c8c68401e7 Fix Http::request() so that it continues to return false on non-200 requests. 2010-02-09 06:18:53 +00:00
Mark A. Hershberger
a126ce6f48 Add a bunch of tests and checks for cookie domain security. 2010-02-08 05:38:09 +00:00
Mark A. Hershberger
4dc061b65f Test cases working with “make tap” but not just “phpunit” right now.
“make tap” spawns a new php instance for each test file.

Found some problems with date/time parsing on older 32bit php.  I
forgot the year 2999 isn't a valid epoch date.
2010-02-07 05:45:37 +00:00
Mark A. Hershberger
c5cbbfd580 Add domain checking to HTTP cookie checking. 2010-02-05 04:08:19 +00:00
Mark A. Hershberger
6e40cc93fa Add preliminary API tests. Next step: UploadChunks API testing. 2010-02-03 07:45:05 +00:00
Mark A. Hershberger
62177bc9d1 follow-up r61655 fill out the rest of the missing messages
Add cookie handling to HttpFunctions.
2010-02-03 06:19:47 +00:00
Mark A. Hershberger
bff36836ab follow up r61357
* fix up fopen warnings — I was bedazzled by phpUnit's
  set_error_handler that turned warnings into exceptions and Tim set
  me right.
* Use Tim's read loop
* No need for private $fh member
* Fix some minor problems with PHP versions (no "timeout" param in
  pre-5.2.1, POST issue in Hardy's PHP version where timeout is null.)
* Fix how tests are run on old versions of phpUnit.
2010-01-29 07:25:09 +00:00
Mark A. Hershberger
a512cc9152 Make the instantiation tests actually work. 2010-01-27 06:51:42 +00:00
Niklas Laxström
03fc54cd44 Log HTTP requests similar to SQL queries and other stuff 2010-01-23 22:30:21 +00:00
Mark A. Hershberger
adc73fd295 follow up r61356 -- remove global 2010-01-23 06:23:18 +00:00
Mark A. Hershberger
5d210b50f3 Follow up 61352, address TimStarling's comments. 2010-01-22 07:50:02 +00:00
Mark A. Hershberger
ec0db4debd stylize, message fixups. 2010-01-22 03:01:48 +00:00
Mark A. Hershberger
5398f6eed2 follow up r61078, fixes bug 22224
Rewrite of HttpFunctions.php
Stripping async download, simple file writer stuff.
2010-01-22 02:17:58 +00:00
Raimond Spekking
826ba4f215 Revert r61078/r61079 for now. Throws a lot of PHP warnings at translatewiki. See CR for details 2010-01-15 18:57:29 +00:00
Jure Kajzer
f05a3b22e4 Fixed fatal error by defineing a blank function in parent class 2010-01-15 10:12:00 +00:00
Mark A. Hershberger
0f1224fd92 follow-up r60811 clean up code, write some tests for the existing uses of HttpFunctions. Still need to test background download, proxy tests, etc. 2010-01-15 05:56:57 +00:00
Michael Dale
2fbb62a4c5 * fix for bug 20512 ( in both trunk and js2-work branch )
** Add 'proxy' option to Http $opts array
** Setting 'proxy' option to "false" will bypass the proxy
* Updated MWSearch_body.php to use new "false" option
2010-01-07 21:57:33 +00:00
Alexandre Emsenhuber
95e1a7210b Doxygen fixes:
* remove duplicated definition of "Wikimedia" group in cleanupTable.inc
* define "HTTP" and "Wikimedia" groups in a separate comment so that doxygen doesn't throw "Cannot assign group to itself"
2009-12-05 17:07:40 +00:00
Chad Horohoe
f9047c8ca1 Fix header 2009-11-28 03:49:29 +00:00
Tim Starling
7688101426 Removed JS2 work (has been moved to the js2-work branch). Has been lightly tested, should mostly work. Some of the more complicated associated changes are listed below.
* Reverted HttpFunctions.php to r45549 and renamed wgSyncHTTPTimeout back to wgHTTPTimeout
* Edited out the asynchronous features from UploadFromUrl. Made fetchFile() use the curlCopy() function from new-upload r47811 instead of Http::doDownload(). Wrote my own URL validity check to avoid having to use either of the two buggy precedents.
* Removed UploadFromChunk
* Removed chunk upload and background status from ApiUpload.php
* Reverted r54669, use of addScriptClass()
* Left getHeadScripts() in its current location (OutputPage) instead of moving it back to SkinTemplate, just added wikibits.js to it to replace the removed addCoreScripts2Top()
2009-11-26 12:00:36 +00:00
Chad Horohoe
14bbcfdcd4 rm unused global 2009-11-06 16:38:19 +00:00
Michael Dale
f5ec8e6ef5 * set the --wiki to wfWikiId 2009-10-20 00:25:36 +00:00
Michael Dale
1e4165061b more (bug 20336)
* added json folder 
* moved Services_JSON.php there
* moved Format JSON into its own class
* updated AutoLoader
2009-09-10 14:33:25 +00:00
Tim Starling
7b7f9f0d4d Comments and whitespace fixes only. 2009-09-10 06:43:01 +00:00
Michael Dale
3bc78b785a * r55034#c3604 re-factored presently used curl options to back-end agnostic options.
* broke out curl and php based requests into separate classes ( more general cleanup is of course possible :)
* @@todo these tokens need to be mapped to php fopen stream "context" along with a more general mapping of the rest of the curl options.
2009-09-01 16:01:51 +00:00
Bryan Tong Minh
c2033042ee * Code style & commenting on upload functions.
* Move isValidURI from UploadFromUrl to HttpFunctions.
* Made some functions in UploadBase static.
2009-08-26 17:05:24 +00:00
Chad Horohoe
4684e284e0 Followup r53884, use wfSuppressWarnings/wfRestoreWarnings instead of @ 2009-08-19 01:55:13 +00:00
Michael Dale
16bf140f66 fixed variable name 2009-08-14 18:56:45 +00:00
Michael Dale
c89ea20030 http:get was clearing opts array (fixed) 2009-08-14 18:03:15 +00:00