Commit Graph

210 Commits

Author SHA1 Message Date
Ilija Tovilo
cfba9cd4bd
Merge branch 'PHP-8.2'
* PHP-8.2:
  Propagate success status of ftp_close() to userland
2023-03-03 15:26:51 +01:00
Ilija Tovilo
4c2ee6fa21
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Propagate success status of ftp_close() to userland
2023-03-03 15:26:45 +01:00
nielsdos
abc6fe8f2e
Propagate success status of ftp_close() to userland
The docs say that this function returns true on success, and false on
error. This function always returns true in the current implementation
because the success return value from ftp_close() is never propagated to
userland. This affects one test: since the test server exits after an
invalid login, the ftp close correctly fails (because the server has
gone away).
2023-03-03 15:26:11 +01:00
Máté Kocsis
7936c8085e
Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
Tim Düsterhus
f9fa6d0415 Mark parameter in ext/ftp as sensitive 2022-06-13 11:09:12 +02:00
Máté Kocsis
debd38f851 Add support for sensitive parameters in stubs 2022-06-04 18:15:05 +02:00
Máté Kocsis
4976483960
Declare ext/ftp constants in stubs (#8703) 2022-06-04 11:59:37 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Nikita Popov
d982f4eb28 Use free_obj handler in FTPConnection 2021-06-09 12:13:15 +02:00
Ayesh Karunaratne
68224f2a41 Move FTP extension class FTPConnection to FTP\Connection
With the [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions) passed, renaming the new `\FTPConnection` class to `\FTP\Connection`.
This also adds an entry to `./UPGRADING` file.

Related: #6925, #5945
2021-05-08 16:40:10 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Christoph M. Becker
895185e5ea
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #79100: Wrong FTP error messages
2021-05-03 15:25:17 +02:00
Christoph M. Becker
c2a06f5d9a
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #79100: Wrong FTP error messages
2021-05-03 15:24:17 +02:00
Christoph M. Becker
42c72ef463
Fix #79100: Wrong FTP error messages
First we need to properly clear the `inbuf`, what is an amendment to
commit d2881adcbc[1].

Then we need to report `php_pollfd_for_ms()` failures right away; just
setting `errno` does not really help, since at least in some cases it
would have been overwritten before we actually could check it.  We use
`php_socket_strerror()` to get a proper error message, and define
`ETIMEDOUT` to the proper value on Windows; otherwise we catch the
definition in errno.h, which is not compatible with WinSock.  The
proper solution for this issue would likely be to include something
like ext/sockets/windows_common.h.

Finally, we ensure that we only report warnings using `inbuf`, if it is
not empty.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=d2881adcbc9be60de7e7d45a3316b0e11b7eb1e8>.

Closes GH-6718.
2021-05-03 15:19:57 +02:00
Máté Kocsis
98fb565c74
Generate class entries from stubs for another batch of extensions
Closes GH-6669
2021-02-08 19:53:55 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Ayesh Karunaratne
012439b78e FTP: Disallow direct FTPConnection construction
Similar to other resource to object migrations, `FTPConnection` class is not allowed to be constructed with `new FTPConnection`.
Related to b4503fbf88.

Closes GH-6533.
2020-12-23 09:54:38 +01:00
Sara Golemon
b4503fbf88 Convert FTP resource to object 2020-10-21 22:29:23 +00:00
Máté Kocsis
e950ca13ea
Consolidate the usage of "either" and "one of" in error messages
Closes GH-6173
2020-09-20 19:41:47 +02:00
Máté Kocsis
1410cd6b08
Promote warnings to exceptions in ext/ftp
Closes GH-6054
2020-08-31 12:49:17 +02:00
George Peter Banyard
fa8d9b1183 Improve type declarations for Zend APIs
Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002
2020-08-28 15:41:27 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
George Peter Banyard
8a18116dba Fix [-Wundef] warning in FTP extension 2020-05-16 15:31:17 +02:00
Máté Kocsis
5322de1ba8
Generate functions entries from stubs for another set of extensions
Closes GH-5351
2020-04-05 00:59:44 +02:00
Máté Kocsis
736b22dc0b
Add stubs for aliases
Closes GH-5187
2020-02-18 21:10:36 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
bbcfa66e06
Use RETURN_THROWS() after zend_fetch_resource*() 2020-01-03 19:20:56 +01:00
Máté Kocsis
382a038e05
Use ZEND_THROWS() during ZPP in enchant, exif, fileinfo, filter, and FTP extensions 2019-12-31 00:21:37 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Christoph M. Becker
4742b2e1de Add stubs for ext/ftp 2019-08-25 14:56:45 +02:00
Nikita Popov
429378d78d Remove some misleading RETURN_FALSE
These functions throw, so they can't return false.

This is just a subset...
2019-08-12 10:05:36 +02:00
Rosen Penev
32e6d08dcd Fix compilation without deprecated OpenSSL 1.1 APIs 2019-06-14 15:38:12 +02:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03: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
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01: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
Dmitry Stogov
265c3ed6cf Fixed incorrrecr zval_dtor() usage to replace value of argument passed by reference, that may lead to memory leaks. 2018-07-05 10:57:49 +03:00
Christoph M. Becker
d5f84fb9c5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix some arginfos
2018-02-23 11:32:18 +01:00
Christoph M. Becker
c6cf3d4ada Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix some arginfos
2018-02-23 11:29:21 +01:00
Gabriel Caruso
0b8cfa6c78 Fix some arginfos
* all arguments for ftp_pasv are required
* $varname for getenv function isn't required anymore
* fsockopen and pfsockopen only require $hostname
* strtok can work with only one parameter
* strpbrk needs two parameters to work
* required parameters and add some parameters in openssl_* functions
2018-02-23 11:27:14 +01:00
Nikita Popov
fc23452cbf Adjust manual zpp-like error message implementations
This should also use int/bool.
2018-02-04 23:27:51 +01: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
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Nikita Popov
60dc329949 Adjust ftp arginfos for optional mode
This was changed in 00cd671233, but
the arginfos were not adjusted.
2017-08-02 20:57:49 +02:00
Andreas Treichel
27c225a5ad Default ftp_append() mode to FTPTYPE_IMAGE
To be consistent with other ftp_*() functions in master.
2017-08-02 20:54:32 +02:00
Nikita Popov
902188e5e3 Merge branch 'PHP-7.2' 2017-08-02 20:53:32 +02:00
Andreas Treichel
29e4d4eee6 Add ftp_append to create a new file or append data to an existing file (RFC959) 2017-08-02 20:52:28 +02:00