Commit graph

127 commits

Author SHA1 Message Date
Tim Starling
6fec4e3fde Revert r87635, r87637, r87639, r87643 (MW_MIN_PHP_VERSION etc.): breaks HipHop support. 2011-05-15 13:21:16 +00:00
Happy-melon
fd34d0354b * Implement MW_VERSION constant in Defines.php and use it in preference to $wgVersion. Defines.php will have been loaded anywhere that DefaultSettings.php has been loaded.
* Move the declaration of $wgFeedClasses from Defines.php to WebStart.php
2011-05-07 14:53:08 +00:00
Sam Reed
d72508dbe7 * (bug 27924) PhpHttpRequest doesn't return response body if HTTP != 200
Apply Bawolffs patch minus the var_dump()'s
2011-03-17 15:14:09 +00:00
Sam Reed
149737fb27 Kill the oldtimeout stuff, with minimum PHP being 5.2.3 2011-03-15 12:24:05 +00:00
Sam Reed
604d1e47b7 After r83879, we're requiring php 5.2.3
Remove < 5.1.7 check and related code
2011-03-15 12:00:53 +00:00
Antoine Musso
a87cc203c6 typo / space fix in HTTP class 2011-03-09 07:12:19 +00:00
Mark A. Hershberger
b3df4babc2 misc w/s cleanups, “svn diff -x-w” clean 2011-03-08 18:12:17 +00:00
Sam Reed
6f9c5532f2 Last few svn property fixes 2011-03-08 02:40:09 +00:00
Sam Reed
350fbc1371 Strip cookie classes out of the middle of HttpFunctions.php into Cookie.php using svn copy 2011-03-07 20:42:55 +00:00
Brian Wolff
65eaa9dae1 (bug 27854) Http::isValidURI is way to lax. This is a much simplified regex that accepts a subset of the previous
regex, but also accepts ftps because both cURL and php support it. It no longer accepts thing like 'foo http://bar bax'
which was my main concern

Note the previous regex kind of looks more restrictive, but is not since saying "anything not containing a space
optionally followed by anything not containing a bunch of characters including a space" is the same as saying anything
with no spaces. See also r83296. This obviously doesn't catch all cases, but I personally think its sufficient.
At the very least it is a very significant improvement over the previous version that caught almost nothing.
2011-03-06 02:43:24 +00:00
Sam Reed
fbe8a15c31 Fix typo in @param comment
Add type to CookieJar

Define $result before loop
2011-03-02 13:07:15 +00:00
Jeroen De Dauw
0e0f81cdae Moved stuff so the cURL class can be used to post files and added constants so you can check if the class allows for file posting 2011-02-27 20:48:52 +00:00
Chad Horohoe
202bd2eb33 Allow callback to be set by options array, inspired by bug 27391 2011-02-14 17:16:39 +00:00
Sam Reed
c5f1a2a031 Explicitally define $domain
Documentation
2011-02-14 14:09:25 +00:00
Platonides
c31f0bc39f Follow up r67663. Now with 100% less sugar, er.. @s! 2010-12-29 16:15:23 +00:00
Brian Wolff
8adc7befe5 (Bug 25872) Rename HttpRequest class to MWHttpRequest to avoid conflict with php extension.
This also keeps the old HttpRequest class name around, so it should not break backwards compatability.
2010-11-12 07:32:09 +00:00
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