Commit graph

644 commits

Author SHA1 Message Date
Nikita Popov
8be12e770f Merge branch 'PHP-7.2' into PHP-7.3 2019-03-01 14:55:15 +01:00
Jay Satiro
5025eb05bd curl_error: return an empty string if no error occurred
CURLOPT_ERRORBUFFER doc says "Do not rely on the contents of the
buffer unless an error code was returned." [1]

Prior to this change the error buffer was returned even if no error had
occurred, and that buffer may contain incorrect information in such a
case. [2]

[1]: https://curl.haxx.se/libcurl/c/CURLOPT_ERRORBUFFER.html
[2]: https://github.com/curl/curl/issues/3629
2019-03-01 14:54:37 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
30024071d2 Fix unused variable warning in curl 2018-12-09 17:05:02 +01:00
Pierrick Charron
b3a6ca90af Fix 77264: curl_getinfo returning microseconds, not seconds
Since curl 7.55.0, libcurl introduced new constants to return
more sensible variable types with curl_getinfo.

When curl_getinfo with no option was called, and curl >= 7.55.0, some
of the result were returned as int when they where returned as float
in previous versions. This commit remove this BC Break.

If someone still want to use more sensible variable types, it's always
possible to call curl_getinfo with newer constants.

CURLINFO_CONTENT_LENGTH_DOWNLOAD => CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
CURLINFO_CONTENT_LENGTH_UPLOAD => CURLINFO_CONTENT_LENGTH_UPLOAD_T
CURLINFO_SIZE_DOWNLOAD => CURLINFO_SIZE_DOWNLOAD_T
CURLINFO_SIZE_UPLOAD => CURLINFO_SIZE_UPLOAD_T
CURLINFO_SPEED_DOWNLOAD => CURLINFO_SPEED_DOWNLOAD_T
CURLINFO_SPEED_UPLOAD => CURLINFO_SPEED_UPLOAD_T
CURLINFO_APPCONNECT_TIME => CURLINFO_APPCONNECT_TIME_T
CURLINFO_CONNECT_TIME => CURLINFO_CONNECT_TIME_T
CURLINFO_NAMELOOKUP_TIME => CURLINFO_NAMELOOKUP_TIME_T
CURLINFO_PRETRANSFER_TIME => CURLINFO_PRETRANSFER_TIME_T
CURLINFO_REDIRECT_TIME => CURLINFO_REDIRECT_TIME_T
CURLINFO_STARTTRANSFER_TIME => CURLINFO_STARTTRANSFER_TIME_T
CURLINFO_TOTAL_TIME => CURLINFO_TOTAL_TIME_T
2018-12-08 15:09:43 -05:00
Pierrick Charron
64881a1e64 Add constants from curl 7.56 to 7.61 2018-10-08 10:19:35 -04:00
Pierrick Charron
02b2dbb724 Add constants from curl 7.50 to 7.55 2018-10-03 19:43:59 -04:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Peter Kokot
b585f043cb Add missing INI directives to curl phpinfo 2018-07-07 12:11:49 +02:00
Xinchen Hui
77e632d04f only warning when the flag is true 2018-06-17 11:39:08 +08:00
Dmitry Stogov
d90c6f2443 Removed useless zval_ptr_dtor() 2018-05-29 17:58:06 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Nikita Popov
47699a24e6 Bump libcurl requirement to 7.15.5
The existence of the following functions is now guaranteed:
 * curl_escape()
 * curl_unescape()
 * curl_multi_setopt()

libcurl 7.15.5 has been released 11.5 years ago and is available
even in RHEL 5.
2018-02-03 21:11:20 +01:00
Benjamin Morel
85021a3993 Add CURLOPT_REQUEST_TARGET constant 2018-02-03 20:43:18 +01:00
Xinchen Hui
4a8229b80d Use GC_ADDREF 2018-01-07 19:53:51 +08:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Nikita Popov
161fd75773 Bump libcurl requirement to 7.12.1
The existence of the following functions is now guaranteed:
 * curl_reset()
 * curl_strerror()
 * curl_multi_strerror()
 * curl_share_strerror()

libcurl 7.12.1 has been released more than 13 years ago and is
available even in RHEL 4.
2017-12-19 23:23:56 +01:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Anatol Belski
d39a9f8ddb Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix compat with libcurl 7.56.1+ and file:// wrapper
2017-12-03 12:29:03 +01:00
Anatol Belski
36f85e17e2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix compat with libcurl 7.56.1+ and file:// wrapper
2017-12-03 12:28:41 +01:00
Anatol Belski
aaf00ae0a9 Fix compat with libcurl 7.56.1+ and file:// wrapper
Since 7.52.x libcurl file:// scheme was implemented in a way described
in https://tools.ietf.org/html/draft-ietf-appsawg-file-scheme-16 . The
draft is still not accepted and the change contained a BC breach with
win32 path handling. It was reported upstream and 7.52.x fixed it, but
the BC breaching behavior was reintroduced in 7.56.1. Thus, it is better
to handle this on the PHP side.
2017-12-03 12:23:25 +01:00
Dmitry Stogov
ccc12b82da Avoid unnecessary reference-counting on strings. 2017-11-16 17:09:32 +03:00
Xinchen Hui
513b0093c2 Refactor php_url struct to save memory dup in common cases 2017-08-06 17:48:05 +08:00
Tom Van Looy
04fb3f28ff Remove superfluous semicolons 2017-06-26 00:23:25 +02:00
Dmitry Stogov
40ecad3402 Fixed wrong usage of old ZPP API. 2017-06-19 18:08:50 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Sara Golemon
994170ea80 Migrate curl to new parameters API
Plus a handful of char*->zend_string* conversions
2016-12-28 09:06:41 -08:00
dedal.qq
d9c4b49c8a New parsing parameters in curl 2016-12-26 11:03:25 -08:00
Sara Golemon
a49675faac Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Interpretation of curl_setopt values for boolean parameters
2016-12-25 22:33:03 -08:00
dedal.qq
7f29e7c678 Interpretation of curl_setopt values for boolean parameters 2016-12-25 22:32:49 -08:00
Christoph M. Becker
0edb16e768 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-29 14:41:12 +02:00
Christoph M. Becker
44968927d7 Add CURLE_SSL_PINNEDPUBKEYNOTMATCH
This error constant is returned on key mismatch when CURLOPT_PINNEDPUBLICKEY
is used. As the option had been introduced in PHP 7.0.7, it makes sense to
also add the related error constant to PHP 7.0+.

Cf. <https://curl.haxx.se/libcurl/c/CURLOPT_PINNEDPUBLICKEY.html>.
2016-09-15 12:20:19 +02:00
Anatol Belski
c560678c14 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  ensure null termination
2016-08-29 21:15:55 +02:00
Anatol Belski
2004585d03 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  ensure null termination
2016-08-29 21:13:39 +02:00
Anatol Belski
d787b0ea13 ensure null termination 2016-08-29 21:03:03 +02:00
Xinchen Hui
ce6ad9bdd9 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: (48 commits)
  Update NEWs
  Unused label
  Fixed bug #72853 (stream_set_blocking doesn't work)
  fix test
  Bug #72663 - part 3
  Bug #72663 - part 2
  Bug #72663 - part 1
  Update NEWS
  BLock test with memory leak
  fix tests
  Fix TSRM build
  Fix bug #72850 - integer overflow in uuencode
  Fixed bug #72849 - integer overflow in urlencode
  Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption
  Fix bug #72838 - 	Integer overflow lead to heap corruption in sql_regcase
  Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
  Fix bug #72836 - integer overflow in base64_decode caused heap corruption
  Fix for bug #72807 - do not produce strings with negative length
  Fix for bug #72790 and bug #72799
  Fix bug #72730 - imagegammacorrect allows arbitrary write access
  ...

Conflicts:
	ext/standard/var_unserializer.c
2016-08-17 17:14:30 +08:00
Stanislav Malyshev
1cd6bc6463 Fix for bug #72807 - do not produce strings with negative length 2016-08-16 22:55:41 -07:00
Stanislav Malyshev
72dbb7f416 Fix bug #72674 - check both curl_escape and curl_unescape 2016-08-03 00:58:55 -07:00
Pierrick Charron
8d44942912 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-27 23:39:34 -04:00
Pierrick Charron
bf37b97d9c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/curl/interface.c
2016-07-27 23:36:22 -04:00
Pierrick Charron
30a5ed3a79 Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). 2016-07-27 23:30:20 -04:00
Pierrick Charron
ca493af862 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-26 19:23:08 -04:00
Pierrick Charron
31ed322b06 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-26 19:20:12 -04:00
Pierrick Charron
24d8f6ed7c Fixed bug #71709
When curl_setopt is called with an empty slist as value, we should
not add the empty slist to the list of slist to free.
2016-07-26 18:50:15 -04:00
Stanislav Malyshev
70d6ce3368 Merge branch 'PHP-7.0'
* PHP-7.0: (27 commits)
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not allow reading past error read
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  update NEWS
  Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72551 and bug #72552 - check before converting size_t->int
  Fix bug #72541 - size_t overflow lead to heap corruption
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  Fix for bug #72513
  CS fix and comments with bug ID
  ...

Conflicts:
	ext/standard/basic_functions.c
2016-07-19 01:44:14 -07:00
Stanislav Malyshev
2ca8d85dd4 Fix bug #72541 - size_t overflow lead to heap corruption 2016-07-12 22:59:19 -07:00
Julien Pauli
78d5783b62 Backported bug #71144 (Segmentation fault when using cURL with ZTS) 2016-07-08 14:58:56 +02:00