Commit Graph

78 Commits

Author SHA1 Message Date
Andrew Nacin 557d9313a7 Introduce constants to allow for easier expression of time periods in seconds. Adds MINUTE_IN_SECONDS, HOUR_IN_SECONDS, DAY_IN_SECONDS, WEEK_IN_SECONDS, YEAR_IN_SECONDS. props nbachiyski, SergeyBiryukov. fixes #20987.
git-svn-id: http://core.svn.wordpress.org/trunk@21996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-25 05:26:19 +00:00
nacin 86d87dd786 Fix typo in HTTP docblock. props ocean90. fixes #21215.
git-svn-id: http://core.svn.wordpress.org/trunk@21290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-20 15:09:11 +00:00
markjaquith d65e49c9f3 Bunch of PHPDoc corrections and cleanups. props c3mdigital. props SergeyBiryukov. fixes #21149
git-svn-id: http://core.svn.wordpress.org/trunk@21241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-09 05:03:53 +00:00
dd32 251719c5e5 WP_HTTP: Add a @link to the Chunked Decode RFC for documentation of how to decode the data correctly. Props mailnew2ster. Fixes #14184
git-svn-id: http://core.svn.wordpress.org/trunk@21231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-08 05:34:47 +00:00
dd32 6f29700fdb WP_HTTP: Remove a empty() check that would never be empty due to the format of HTTP Headers, value would always contain at least a space followed by the value. See #14184
git-svn-id: http://core.svn.wordpress.org/trunk@21230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-08 05:16:26 +00:00
dd32 4db9e5c605 WP_HTTP: Allow for cookies with "empty" values be sent, this affects sending cookies such as test=0, which would previously fail. Props mailnew2ster for initial patch. See #14184
git-svn-id: http://core.svn.wordpress.org/trunk@21227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-07 12:06:09 +00:00
dd32 2005aed7e6 WP_HTTP: Respect that some cookies do not have an expiration time, this is a valid use-case that WP_HTTP_Cookie::test() should not discard, a non-existant expiration date simply means to let it expire at the end of the session. Props mailnew2ster. Fixes #14191
git-svn-id: http://core.svn.wordpress.org/trunk@21226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-07 04:23:49 +00:00
dd32 9ed35c4586 WP_HTTP: Add a filter to WP_HTTP_Proxy::send_through_proxy() to allow for plugins to modify which requests are sent to a proxy dynamically. Fixes #20222
git-svn-id: http://core.svn.wordpress.org/trunk@21225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-07 02:27:13 +00:00
ryan 08d01e2950 Handle relative urls when processing redirects. Introduce WP_Http::make_absolute_url(). Props dd32. fixes #20434
git-svn-id: http://core.svn.wordpress.org/trunk@20767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-10 21:32:02 +00:00
dd32 98e33b2f9b WP_HTTP: Curl: $theHeaders is an array, not an object, introduced in [20370]. Props kurtpayne. Fixes #20389 See #20219
git-svn-id: http://svn.automattic.com/wordpress/trunk@20399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-07 07:16:30 +00:00
westi a1c575b671 Fix typo in [20372] - See #19922 props SergeyBiryukov.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-05 15:34:28 +00:00
westi 5b6c025cc3 HTTP: Don't force cookie values to be urlencoded because it breaks usage of cookies in some scenarios like the LiveJournal Importer. Instead add a filter for a plugin to use if it really wants to have the cookie mangled. Fixes #19922 props pw201, dllh and kurtpayne.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-05 15:17:34 +00:00
dd32 c5b25fd6d0 WP_HTTP: Curl: Correct a typo in [20208] causing failed curl requests not to return a WP_Error under certain situations. Props SergeyBiryukov. Fixes #20219
git-svn-id: http://svn.automattic.com/wordpress/trunk@20370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-05 11:58:04 +00:00
dd32 f314fb3ea7 WP_HTTP: Curl: Handle Redirections in PHP rather than internally in Curl, Simplifies code flow between safe_mode On and Off, and works around certain bugs. Props simonwheatley for initial patch. Fixes #20219, Fixes #17490
git-svn-id: http://svn.automattic.com/wordpress/trunk@20208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-18 05:00:05 +00:00
dd32 5bc2f55d50 WP_Http: cURL: Use the parsed args $r, rather than the raw $args. Mentioned in #20219
git-svn-id: http://svn.automattic.com/wordpress/trunk@20207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-18 03:12:12 +00:00
dd32 ef6661a628 WP_HTTP: Send the body with custom method requests when using cURL. Fixes #18589
git-svn-id: http://svn.automattic.com/wordpress/trunk@20183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-15 05:33:38 +00:00
dd32 3abb558ae8 Support custom HTTP Methods in WP_Http_Curl. Brings it in line with the other HTTP transports of respecting the requested method. Props zx2c4. Fixes #18589
git-svn-id: http://svn.automattic.com/wordpress/trunk@19696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-06 12:53:44 +00:00
ryan 83b131f8e3 User lowercase true, false, null instead of uppercase. Props c3mdigital, mfields. fixes #16302
git-svn-id: http://svn.automattic.com/wordpress/trunk@19687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-05 20:50:54 +00:00
ryan 616c35e71c One newline is enough.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-05 20:10:39 +00:00
ryan c924060858 Remove extraneuos newlines
git-svn-id: http://svn.automattic.com/wordpress/trunk@19623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-21 18:42:11 +00:00
ryan 07ff8b216b Use one space, not two, after trailing punctuation. fixes #19537
git-svn-id: http://svn.automattic.com/wordpress/trunk@19593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-13 23:45:31 +00:00
ryan 28b1b4763d Avoid E_STRICT notices. see #18975
git-svn-id: http://svn.automattic.com/wordpress/trunk@19094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-31 19:38:46 +00:00
ryan 62afab8db3 Pinking shears
git-svn-id: http://svn.automattic.com/wordpress/trunk@19054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-24 19:13:23 +00:00
dd32 ee71b2eb88 Respect the Content-Type header developers pass to WP_HTTP. Fixes #18982
git-svn-id: http://svn.automattic.com/wordpress/trunk@19000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-19 04:48:00 +00:00
dd32 f1ffd16440 Document the Magic numbering in WP_Http_Encoding::compatible_gzinflate(). Fixes #18273
git-svn-id: http://svn.automattic.com/wordpress/trunk@18806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-29 02:10:35 +00:00
dd32 08bea55949 Pass $args and $url to the http_api_debug action to improve debugging. Props johnbillion. Fixes #18732
git-svn-id: http://svn.automattic.com/wordpress/trunk@18805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-29 01:42:09 +00:00
dd32 f40bc45b6f Add inflation support for java.util.zip.Deflater in WP_Http_Encoding::compatible_gzinflate(). Fixes #18273
git-svn-id: http://svn.automattic.com/wordpress/trunk@18718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-19 14:43:43 +00:00
duck_ e4ed63fc6f Fix typos in documentation (wp-includes/[a-h]). See #18560.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-03 16:02:41 +00:00
ryan 28b241df2b Empty headers instance var instead of unsetting to avoid warning. Props chrisbliss18. fixes #18157
git-svn-id: http://svn.automattic.com/wordpress/trunk@18457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-07-21 21:44:35 +00:00
ryan daa14c36f9 Bring out the pinking shears.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-10 23:01:45 +00:00
ryan a98d5a605c HTTP API PHP Doc Updates. Props sivel. fixes #17724
git-svn-id: http://svn.automattic.com/wordpress/trunk@18185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-08 00:51:31 +00:00
westi 65e341d0cb Fix typos and inconsistencies in PHPdoc / function declarations. See #17414 props duck_
git-svn-id: http://svn.automattic.com/wordpress/trunk@17925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-14 09:50:20 +00:00
westi 81cd0218ec Introduce wp_http_supports as a much less hacky replacement for the http_transport_(get|post)_debug hooks that plugins could have
been using to detect if things like ssl requests were working.
See #17251 props mdawaffe


git-svn-id: http://svn.automattic.com/wordpress/trunk@17914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-13 09:56:59 +00:00
ryan 04487fc268 Constructor cleanup. Props ocean90. fixes #16768
git-svn-id: http://svn.automattic.com/wordpress/trunk@17771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-29 20:05:12 +00:00
dd32 ad5f5db861 Allow the cURL transport to handle '0' response bodies. Fixes #17223
git-svn-id: http://svn.automattic.com/wordpress/trunk@17692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-23 13:49:52 +00:00
dd32 e2b914fbad Remove support for the PHP HTTP Extension from WP_HTTP. The PHP HTTP Extension is a wrapper around libcurl and fopen() providing limited configuration and is supported on a minority of servers due to its non-default inclusion. Props sivel. Fixes @16978
git-svn-id: http://svn.automattic.com/wordpress/trunk@17659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-19 04:22:59 +00:00
dd32 c1e70ae5e6 Verify certificate matches both the common name and the provided hostname. WP_HTTP_Curl requires CURLOPT_SSL_VERIFYHOST be either 2 or false. Props sivel. Fixes #16904
git-svn-id: http://svn.automattic.com/wordpress/trunk@17616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-07 08:38:36 +00:00
dd32 864330c766 explode always returns an array in this context. Props hakre. Fixes #16958
git-svn-id: http://svn.automattic.com/wordpress/trunk@17600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-05 06:41:51 +00:00
dd32 b4d213c7a5 Fix warning in HTTP Header parsing where response message is not specified. Props hakre. Fixes #16885
git-svn-id: http://svn.automattic.com/wordpress/trunk@17599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-05 06:21:56 +00:00
dd32 d5ae0717c0 Streamline WP_Http_*::test() methods: Check basic SSL requirements, only allow filters to disable transports, not enable them after ::test() has failed. Props mdawaffe for the initial patch. See #16606
git-svn-id: http://svn.automattic.com/wordpress/trunk@17598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-05 06:09:43 +00:00
dd32 06dab650ac Return 4xx errors as a standard response from WP_HTTP, Brings it in line with the rest of the transports for 4xx error handling. See #17010
git-svn-id: http://svn.automattic.com/wordpress/trunk@17597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-05 04:06:40 +00:00
dd32 ef063f8508 Use the correct variable name; Simpler static initialisation. Props hakre. See #11613 & #16978
git-svn-id: http://svn.automattic.com/wordpress/trunk@17566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-28 09:55:15 +00:00
dd32 de498967ef Correct logic for cURL Errors, add extra sanity protection in ::processHeaders to guard against null inputs. See #16236
git-svn-id: http://svn.automattic.com/wordpress/trunk@17563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-26 03:32:05 +00:00
dd32 00dc7a57d6 First run of introducing Stream-To-File for the WP_HTTP API. Reduces memory consumption during file downloads. Implemented in download_url() for upgraders. Props sivel. See #16236
git-svn-id: http://svn.automattic.com/wordpress/trunk@17555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-25 02:42:20 +00:00
dd32 0e08826bbd Allow for array('redirection' => 0) to bypass WP_Error on redirects being encountered; Allows HEAD requests WITH 'redirection' > 0 specified at call time to follow redirections; Standardises on return values from all transports to act the same based on the Unit Tests. Fixes #16855
git-svn-id: http://svn.automattic.com/wordpress/trunk@17551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-24 05:18:34 +00:00
dd32 6dd4dbec38 Fix WP_HTTP to only make a request upon a working transport, as well as to allow Unit Testing. Removes the getTransport() & postTransport() methods as they're no longer needed, replaces them with a single _dispatch_request() method. Fixes #11613
git-svn-id: http://svn.automattic.com/wordpress/trunk@17550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-24 02:16:13 +00:00
dd32 9fec2e59dc Prune PHP5 compat checks in WP_Http, WP_Http_Curl & WP_Http_Streams. Only removes pre PHP 5.2.4 conditional code. See #13915
git-svn-id: http://svn.automattic.com/wordpress/trunk@17535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-23 11:58:09 +00:00
dd32 ebf169b350 Remove PHP4 based WP_Http_Fopen class. Props sivel for initial patch. See #16917 Fixes #13915
git-svn-id: http://svn.automattic.com/wordpress/trunk@17534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-23 11:35:41 +00:00
nacin b0ad5b5928 Just a typo of the class name. fixes #14786.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-01-13 05:08:40 +00:00
nacin 26d7de2d93 We only need strpos here. Ensures PHP4 compat. props mailnew2ster, fixes #14187.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-07 07:17:06 +00:00