Sam Reed
f619564720
* (bug 32341) Add upload by URL domain limitation.
2012-01-19 19:16:06 +00:00
Brion Vibber
2fc16ba670
Add comments explaining that the funky multiple Location headers stuff is a CURL artifact, and that the code will need updating if bug 29232 is done (high-level handling of http redirects)
...
Followup r94881, r106948.
2011-12-22 23:12:44 +00:00
Roan Kattouw
c5a18b323a
(bug 310720) Make Http::request() (and, by extension, get() and post() as well) accept a 'userAgent' option. Patch by Chad Horohoe
2011-11-20 17:45:18 +00:00
Platonides
2af42298c1
Follow-up r101808. Use canonical class name.
2011-11-03 22:58:16 +00:00
Mark A. Hershberger
c69ddf40aa
typo
2011-11-03 15:14:02 +00:00
Antoine Musso
57faa0c794
comment that isValidURI must reject file:// URI
2011-11-03 15:06:52 +00:00
Mark A. Hershberger
d379979d1a
use isValidURI for redirect check
2011-11-03 14:04:01 +00:00
Sam Reed
52cd34acf5
More documentation
2011-10-29 01:53:28 +00:00
Tobias
596a9e77e8
Disable proxy for local URLs instead of using a local proxy (which might not always exist). In r61357 a comment "Not sure this makes any sense." was removed. Indeed, that comment seems to have been right :)
2011-10-28 23:02:30 +00:00
Sam Reed
abe7663d8c
Documentation
...
Swap a lot of "@returns" to "@return"
2011-10-13 18:44:26 +00:00
Roan Kattouw
fe82ae0e27
Use wfParseUrl() instead of parse_url() in MWHttpRequest::__construct(), and check the return value for false
2011-09-08 13:53:18 +00:00
Roan Kattouw
37e3f5dff5
Move URL expansion from Http::request() (where it was put in r93820) to MWHttpRequest::__construct(). That should fix bug 30797 (UploadStash barfs on protocol-relative URLs)
2011-09-08 13:48:11 +00:00
Roan Kattouw
75681bc57a
Expand some more URLs: for feeds, referers and the proxy script
2011-08-19 17:31:40 +00:00
Marooned
0102df8489
Relative values of the "Location" header are incorrect as stated in RFC, however they do happen and modern browsers support them.
...
This function loops backwards through all locations in order to build the proper absolute URI - Marooned at wikia-inc.com
2011-08-18 10:33:39 +00:00
Roan Kattouw
ae7d7676fb
Fix r93820: PROT_ -> PROTO_
2011-08-03 13:11:42 +00:00
Roan Kattouw
6adb2e86a5
Some random URL protocol forcing for protocol-relative URLs
2011-08-03 12:58:21 +00:00
Chad Horohoe
4f21bb309e
(bug 29959) Installer fatal when cURL and allow_url_fopen is disabled and user tries to subsribe to mediawiki-announce
...
Really, I'm not sure about the usefulness of exploding with a MWException anytime we can't do an external request, but at least we can stop the installer from exploding :)
2011-07-18 21:56:10 +00:00
Krinkle
0e22bbc883
Reverting r91642 per CR and pending review need-patch/patch in bug 29755
2011-07-08 17:45:26 +00:00
Mark A. Hershberger
1c712a6cc6
Bug #29755 : Apply patch from Vitaliy Filippov so that MW's HTTP client
...
respects no_proxy env setting
2011-07-07 14:56:18 +00:00
Mark A. Hershberger
20d5ed9326
follow up r89278 — remove FTP support.
2011-06-04 02:59:10 +00:00
Brion Vibber
29aedac7db
Add some doc comments on Cookie::validateCookieDomain() and Http::isValidUri(), which both have some failing test cases and are incomplete
2011-06-01 22:35:03 +00:00
Mark A. Hershberger
623083aa78
Fix Bug #29231 : PhpHttpRequest doesn't support HTTPS
...
Tested fix with PHPUnit Tests that aren't currently executed by
CruiseControl b/c they're marked “broken” till someone comes up with
some reasonable unit tests that will work for everyone.
2011-06-01 18:57:33 +00:00
Sam Reed
4065e65d03
Even more documentation in various files
2011-05-29 14:24:27 +00:00
Brion Vibber
c07ed42491
* (bug 29174) Fix regression in upload-by-URL: files larger than PHP memory limit work again
...
r65152 switched upload-by-URL ($wgAllowCopyUploads) to use Http / MwHttpRequest class instead of CURL directly.
While this is mostly nice, it switched from saving large files directly to a temp file to buffering them in memory, causing large files to fail when they hit the PHP memory limit.
Fix uses MwHttpRequest's callback capability to override the read handler; now appending it to the temporary file as we go, and can confirm that largish files work again; was able to upload a 64mb .ogv that previously didn't work for me: http://prototype.wikimedia.org/tmh/images/b/b2/File-Arborophila_brunneopectus_pair_feeding_-_Kaeng_Krachan.ogv
Also expanded the documentation on MwHttpRequest::setCallback to clarify the function parameters and return value for the callback (which currently matches the low-level CURL handler's callback directly).
Note that the non-CURL implementation doesn't abort the read if the callback doesn't return the expected number of bytes, but this is an immediate fatal end of request on the Curl backend. May want further cleanup.
2011-05-27 22:31:48 +00:00
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